home *** CD-ROM | disk | FTP | other *** search
/ Maclife 157 / MACLIFE157-2001-09.ISO.7z / MACLIFE157-2001-09.ISO / Linux / MacOS Tools / Other / BootX 1.1.3 (for Old Mac OS) / Sources / lib / From MoreFiles / MoreFilesExtras.h < prev    next >
Text File  |  2001-07-23  |  116KB  |  3,137 lines

  1. /*
  2. **    Apple Macintosh Developer Technical Support
  3. **
  4. **    A collection of useful high-level File Manager routines.
  5. **
  6. **    by Jim Luther, Apple Developer Technical Support Emeritus
  7. **
  8. **    File:        MoreFilesExtras.h
  9. **
  10. **    Copyright ゥ 1992-1998 Apple Computer, Inc.
  11. **    All rights reserved.
  12. **
  13. **    You may incorporate this sample code into your applications without
  14. **    restriction, though the sample code has been provided "AS IS" and the
  15. **    responsibility for its operation is 100% yours.  However, what you are
  16. **    not permitted to do is to redistribute the source as "DSC Sample Code"
  17. **    after having made changes. If you're going to re-distribute the source,
  18. **    we require that you make it clear in the source that the code was
  19. **    descended from Apple Sample Code, but that you've made changes.
  20. */
  21.  
  22. #ifndef __MOREFILESEXTRAS__
  23. #define __MOREFILESEXTRAS__
  24.  
  25. #include <Types.h>
  26. #include <Files.h>
  27.  
  28. #include "Optimization.h"
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33.  
  34. /*****************************************************************************/
  35.  
  36. /* Constants and types from Universal Interfaces 3.0.1 Files.h */
  37.  
  38. #if    UNIVERSAL_INTERFACES_VERSION < 0x0301
  39.  
  40. enum {
  41.     volMountNoLoginMsgFlagBit    = 0,                            /* Input to VolumeMount: If set, the file system */
  42.     volMountNoLoginMsgFlagMask    = 0x0001,                        /*  should suppresss any log-in message/greeting dialog */
  43.     volMountExtendedFlagsBit    = 7,                            /* Input to VolumeMount: If set, the mount info is a */
  44.     volMountExtendedFlagsMask    = 0x0080                        /*  AFPXVolMountInfo record for 3.7 AppleShare Client */
  45. };
  46.  
  47. /* AFPXVolMountInfo is the new AFP volume mount info record, requires the 3.7 AppleShare Client */
  48.  
  49. struct AFPXVolMountInfo {
  50.     short                             length;                        /* length of location data (including self) */
  51.     VolumeType                         media;                        /* type of media */
  52.     short                             flags;                        /* bits for no messages, no reconnect */
  53.     SInt8                             nbpInterval;                /* NBP Interval parameter (IM2, p.322) */
  54.     SInt8                             nbpCount;                    /* NBP Interval parameter (IM2, p.322) */
  55.     short                             uamType;                    /* User Authentication Method type */
  56.     short                             zoneNameOffset;                /* short positive offset from start of struct to Zone Name */
  57.     short                             serverNameOffset;            /* offset to pascal Server Name string */
  58.     short                             volNameOffset;                /* offset to pascal Volume Name string */
  59.     short                             userNameOffset;                /* offset to pascal User Name string */
  60.     short                             userPasswordOffset;            /* offset to pascal User Password string */
  61.     short                             volPasswordOffset;            /* offset to pascal Volume Password string */
  62.     short                             extendedFlags;                /* extended flags word */
  63.     short                             uamNameOffset;                /* offset to a pascal UAM name string */
  64.     short                             alternateAddressOffset;        /* offset to Alternate Addresses in tagged format */
  65.     char                             AFPData[176];                /* variable length data may follow */
  66. };
  67. typedef struct AFPXVolMountInfo            AFPXVolMountInfo;
  68. typedef AFPXVolMountInfo *                AFPXVolMountInfoPtr;
  69.  
  70. enum {
  71.     kAFPExtendedFlagsAlternateAddressMask = 1                    /*  bit in AFPXVolMountInfo.extendedFlags that means alternateAddressOffset is used*/
  72. };
  73.  
  74. enum {
  75.                                                                 /* constants for use in AFPTagData.fType field*/
  76.     kAFPTagTypeIP                = 0x01,
  77.     kAFPTagTypeIPPort            = 0x02,
  78.     kAFPTagTypeDDP                = 0x03                            /* Currently unused*/
  79. };
  80.  
  81. enum {
  82.                                                                 /* constants for use in AFPTagData.fLength field*/
  83.     kAFPTagLengthIP                = 0x06,
  84.     kAFPTagLengthIPPort            = 0x08,
  85.     kAFPTagLengthDDP            = 0x06
  86. };
  87.  
  88. struct AFPTagData {
  89.     UInt8                             fLength;                    /* length of this data tag including the fLength field */
  90.     UInt8                             fType;
  91.     UInt8                             fData[1];                    /* variable length data */
  92. };
  93. typedef struct AFPTagData                AFPTagData;
  94.  
  95. struct AFPAlternateAddress {
  96.     UInt8                             fAddressCount;
  97.     UInt8                             fAddressList[1];            /* actually variable length packed set of AFPTagData */
  98. };
  99. typedef struct AFPAlternateAddress        AFPAlternateAddress;
  100.  
  101. #endif
  102.  
  103. /*****************************************************************************/
  104.  
  105. /*
  106. **    Macros to get information out of GetVolParmsInfoBuffer
  107. */
  108.  
  109. #define    isNetworkVolume(volParms)    ((volParms).vMServerAdr != 0)
  110. #define    hasLimitFCBs(volParms)        (((volParms).vMAttrib & (1L << bLimitFCBs)) != 0)
  111. #define    hasLocalWList(volParms)        (((volParms).vMAttrib & (1L << bLocalWList)) != 0)
  112. #define    hasNoMiniFndr(volParms)        (((volParms).vMAttrib & (1L << bNoMiniFndr)) != 0)
  113. #define hasNoVNEdit(volParms)        (((volParms).vMAttrib & (1L << bNoVNEdit)) != 0)
  114. #define hasNoLclSync(volParms)        (((volParms).vMAttrib & (1L << bNoLclSync)) != 0)
  115. #define hasTrshOffLine(volParms)    (((volParms).vMAttrib & (1L << bTrshOffLine)) != 0)
  116. #define hasNoSwitchTo(volParms)        (((volParms).vMAttrib & (1L << bNoSwitchTo)) != 0)
  117. #define hasNoDeskItems(volParms)    (((volParms).vMAttrib & (1L << bNoDeskItems)) != 0)
  118. #define hasNoBootBlks(volParms)        (((volParms).vMAttrib & (1L << bNoBootBlks)) != 0)
  119. #define hasAccessCntl(volParms)        (((volParms).vMAttrib & (1L << bAccessCntl)) != 0)
  120. #define hasNoSysDir(volParms)        (((volParms).vMAttrib & (1L << bNoSysDir)) != 0)
  121. #define hasExtFSVol(volParms)        (((volParms).vMAttrib & (1L << bHasExtFSVol)) != 0)
  122. #define hasOpenDeny(volParms)        (((volParms).vMAttrib & (1L << bHasOpenDeny)) != 0)
  123. #define hasCopyFile(volParms)        (((volParms).vMAttrib & (1L << bHasCopyFile)) != 0)
  124. #define hasMoveRename(volParms)        (((volParms).vMAttrib & (1L << bHasMoveRename)) != 0)
  125. #define hasDesktopMgr(volParms)        (((volParms).vMAttrib & (1L << bHasDesktopMgr)) != 0)
  126. #define hasShortName(volParms)        (((volParms).vMAttrib & (1L << bHasShortName)) != 0)
  127. #define hasFolderLock(volParms)        (((volParms).vMAttrib & (1L << bHasFolderLock)) != 0)
  128. #define hasPersonalAccessPrivileges(volParms) ¥
  129.         (((volParms).vMAttrib & (1L << bHasPersonalAccessPrivileges)) != 0)
  130. #define hasUserGroupList(volParms)    (((volParms).vMAttrib & (1L << bHasUserGroupList)) != 0)
  131. #define hasCatSearch(volParms)        (((volParms).vMAttrib & (1L << bHasCatSearch)) != 0)
  132. #define hasFileIDs(volParms)        (((volParms).vMAttrib & (1L << bHasFileIDs)) != 0)
  133. #define hasBTreeMgr(volParms)        (((volParms).vMAttrib & (1L << bHasBTreeMgr)) != 0)
  134. #define hasBlankAccessPrivileges(volParms) ¥
  135.         (((volParms).vMAttrib & (1L << bHasBlankAccessPrivileges)) != 0)
  136.  
  137. /*****************************************************************************/
  138.  
  139.  
  140. /*
  141. **    Bit masks and macros to get common information out of ioACUser returned
  142. **    by PBGetCatInfo (remember to clear ioACUser before calling PBGetCatInfo
  143. **    since some file systems don't bother to set this field).
  144. **
  145. **    Use the GetDirAccessRestrictions or FSpGetDirAccessRestrictions
  146. **    functions to retrieve the ioACUser access restrictions byte for
  147. **    a folder.
  148. **
  149. **    Note:    The access restriction byte returned by PBGetCatInfo is the
  150. **            2's complement of the user's privileges byte returned in
  151. **            ioACAccess by PBHGetDirAccess.
  152. */
  153.  
  154. enum
  155. {
  156.     /* bits defined in ioACUser */
  157.     acUserNoSeeFoldersMask    = 0x01,
  158.     acUserNoSeeFilesMask    = 0x02,
  159.     acUserNoMakeChangesMask    = 0x04,
  160.     acUserNotOwnerMask        = 0x80,
  161.     
  162.     /* mask for just the access restriction bits */
  163.     acUserAccessMask        = 0x07,
  164.     
  165.     /* common access privilege settings */
  166.     acUserFull                = 0x00,                        /* no access restiction bits on */
  167.     acUserNone                = acUserAccessMask,            /* all access restiction bits on */
  168.     acUserDropBox            = acUserNoSeeFoldersMask + acUserNoSeeFilesMask, /* make changes, but not see files or folders */
  169.     acUserBulletinBoard        = acUserNoMakeChangesMask    /* see files and folders, but not make changes */
  170. };
  171.  
  172. /* Macros for testing ioACUser bits */
  173. #define    userIsOwner(ioACUser)    ¥
  174.         (((ioACUser) & acUserNotOwnerMask) == 0)
  175. #define    userHasFullAccess(ioACUser)    ¥
  176.         (((ioACUser) & (acUserAccessMask)) == acUserFull)
  177. #define    userHasDropBoxAccess(ioACUser)    ¥
  178.         (((ioACUser) & acUserAccessMask) == acUserDropBox)
  179. #define    userHasBulletinBoard(ioACUser)    ¥
  180.         (((ioACUser) & acUserAccessMask) == acUserBulletinBoard)
  181. #define    userHasNoAccess(ioACUser)        ¥
  182.         (((ioACUser) & acUserAccessMask) == acUserNone)
  183.  
  184. /*****************************************************************************/
  185.  
  186. /*
  187. **    Deny mode permissions for use with the HOpenAware, HOpenRFAware,
  188. **    FSpOpenAware, and FSpOpenRFAware functions.
  189. */
  190.  
  191. enum
  192. {
  193.     dmNone            = 0x0000,
  194.     dmNoneDenyRd    = 0x0010,
  195.     dmNoneDenyWr    = 0x0020,
  196.     dmNoneDenyRdWr    = 0x0030,
  197.     dmRd            = 0x0001,    /* Single writer, multiple readers; the readers */
  198.     dmRdDenyRd        = 0x0011,
  199.     dmRdDenyWr        = 0x0021,    /* Browsing - equivalent to fsRdPerm */
  200.     dmRdDenyRdWr    = 0x0031,
  201.     dmWr            = 0x0002,
  202.     dmWrDenyRd        = 0x0012,
  203.     dmWrDenyWr        = 0x0022,
  204.     dmWrDenyRdWr    = 0x0032,
  205.     dmRdWr            = 0x0003,    /* Shared access - equivalent to fsRdWrShPerm */
  206.     dmRdWrDenyRd    = 0x0013,
  207.     dmRdWrDenyWr    = 0x0023,    /* Single writer, multiple readers; the writer */
  208.     dmRdWrDenyRdWr    = 0x0033    /* Exclusive access - equivalent to fsRdWrPerm */
  209. };
  210.     
  211. /*****************************************************************************/
  212.  
  213. #if PRAGMA_ALIGN_SUPPORTED
  214. #pragma options align=mac68k
  215. #endif
  216.  
  217. /*
  218. **    For those times where you need to use more than one kind of File Manager parameter
  219. **    block but don't feel like wasting stack space, here's a parameter block you can reuse.
  220. */
  221.  
  222. union UniversalFMPB
  223. {
  224.     ParamBlockRec    PB;
  225.     CInfoPBRec        ciPB;
  226.     DTPBRec            dtPB;
  227.     HParamBlockRec    hPB;
  228.     CMovePBRec        cmPB;
  229.     WDPBRec            wdPB;
  230.     FCBPBRec        fcbPB;
  231.     XVolumeParam    xPB;
  232. };
  233. typedef union UniversalFMPB UniversalFMPB;
  234. typedef UniversalFMPB *UniversalFMPBPtr, **UniversalFMPBHandle;
  235.  
  236.  
  237. /*
  238. **    Used by GetUGEntries to return user or group lists
  239. */
  240.  
  241. struct UGEntry
  242. {
  243.     short    objType;    /* object type: -1 = group; 0 = user */
  244.     long    objID;        /* the user or group ID */
  245.     Str31    name;        /* the user or group name */
  246. };
  247. typedef struct UGEntry UGEntry;
  248. typedef UGEntry *UGEntryPtr, **UGEntryHandle;
  249.  
  250.  
  251. typedef unsigned char Str8[9];
  252.  
  253.  
  254. /*
  255. **    I use the following records instead of the AFPVolMountInfo and AFPXVolMountInfo structures in Files.h
  256. */
  257.  
  258. struct MyAFPVolMountInfo
  259. {
  260.     short length;                /* length of this record */
  261.     VolumeType media;            /* type of media, always AppleShareMediaType */
  262.     short flags;                /* 0 = normal mount; set bit 0 to inhibit greeting messages */
  263.     char nbpInterval;            /* NBP interval parameter; 7 is a good choice */
  264.     char nbpCount;                /* NBP count parameter; 5 is a good choice */
  265.     short uamType;                /* User Authentication Method */
  266.     short zoneNameOffset;        /* offset from start of record to zoneName */
  267.     short serverNameOffset;        /* offset from start of record to serverName */
  268.     short volNameOffset;        /* offset from start of record to volName */
  269.     short userNameOffset;        /* offset from start of record to userName */
  270.     short userPasswordOffset;    /* offset from start of record to userPassword */
  271.     short volPasswordOffset;    /* offset from start of record to volPassword */
  272.     Str32 zoneName;                /* server's AppleTalk zone name */                    
  273.     char filler1;                /* to word align volPassword */
  274.     Str32 serverName;            /* server name */                    
  275.     char filler2;                /* to word align volPassword */
  276.     Str27 volName;                /* volume name */                    
  277.     Str31 userName;                /* user name (zero length Pascal string for guest) */
  278.     Str8 userPassword;            /* user password (zero length Pascal string if no user password) */                    
  279.     char filler3;                /* to word align volPassword */
  280.     Str8 volPassword;            /* volume password (zero length Pascal string if no volume password) */                    
  281.     char filler4;                /* to end record on word boundry */
  282. };
  283. typedef struct MyAFPVolMountInfo MyAFPVolMountInfo;
  284. typedef MyAFPVolMountInfo *MyAFPVolMountInfoPtr, **MyAFPVolMountInfoHandle;
  285.  
  286. struct MyAFPXVolMountInfo
  287. {
  288.     short length;                /* length of this record */
  289.     VolumeType media;            /* type of media, always AppleShareMediaType */
  290.     short flags;                /* bits for no messages, no reconnect, etc */
  291.     char nbpInterval;            /* NBP interval parameter; 7 is a good choice */
  292.     char nbpCount;                /* NBP count parameter; 5 is a good choice */
  293.     short uamType;                /* User Authentication Method */
  294.     short zoneNameOffset;        /* offset from start of record to zoneName */
  295.     short serverNameOffset;        /* offset from start of record to serverName */
  296.     short volNameOffset;        /* offset from start of record to volName */
  297.     short userNameOffset;        /* offset from start of record to userName */
  298.     short userPasswordOffset;    /* offset from start of record to userPassword */
  299.     short volPasswordOffset;    /* offset from start of record to volPassword */
  300.     short extendedFlags;        /* extended flags word */
  301.     short uamNameOffset;        /* offset to a pascal UAM name string */
  302.     short alternateAddressOffset; /* offset to Alternate Addresses in tagged format */
  303.     Str32 zoneName;                /* server's AppleTalk zone name */                    
  304.     char filler1;                /* to word align volPassword */
  305.     Str32 serverName;            /* server name */                    
  306.     char filler2;                /* to word align volPassword */
  307.     Str27 volName;                /* volume name */                    
  308.     Str31 userName;                /* user name (zero length Pascal string for guest) */
  309.     Str8 userPassword;            /* user password (zero length Pascal string if no user password) */                    
  310.     char filler3;                /* to word align volPassword */
  311.     Str8 volPassword;            /* volume password (zero length Pascal string if no volume password) */                    
  312.     char filler4;                /* to word align uamNameOffset */
  313.     Str32 uamName;                /* UAM name */
  314.     char filler5;                /* to word align alternateAddress */
  315.     char alternateAddress[kVariableLengthArray];    /* AFPAlternateAddress */
  316. };
  317. typedef struct MyAFPXVolMountInfo MyAFPXVolMountInfo;
  318. typedef MyAFPXVolMountInfo *MyAFPXVolMountInfoPtr, **MyAFPXVolMountInfoHandle;
  319.  
  320. #if PRAGMA_ALIGN_SUPPORTED
  321. #pragma options align=reset
  322. #endif
  323.  
  324. /*****************************************************************************/
  325.  
  326. pascal    void    TruncPString(StringPtr destination,
  327.                              ConstStr255Param source,
  328.                              short maxLength);
  329. /*    ヲ International friendly string truncate routine.
  330.     The TruncPString function copies up to maxLength characters from
  331.     the source Pascal string to the destination Pascal string. TruncPString
  332.     ensures that the truncated string ends on a single-byte character, or on
  333.     the last byte of a multi-byte character.
  334.     
  335.     destination        output:    destination Pascal string.
  336.     source            input:    source Pascal string.
  337.     maxLength        output:    The maximum allowable length of the destination
  338.                             string.
  339. */
  340.  
  341. /*****************************************************************************/
  342.  
  343. pascal    Ptr    GetTempBuffer(long buffReqSize,
  344.                           long *buffActSize);
  345. /*    ヲ Allocate a temporary copy or search buffer.
  346.     The GetTempBuffer function allocates a temporary buffer for file system
  347.     operations which is at least 1024 bytes (1K) and a multiple of
  348.     1024 bytes.
  349.     
  350.     buffReqSize        input:    Size you'd like the buffer to be.
  351.     buffActSize        output:    Size of buffer allocated.
  352.     function result    output:    Pointer to memory allocated or nil if no memory
  353.                             was available. The caller is responsible for
  354.                             disposing of this buffer with DisposePtr.
  355. */
  356.  
  357. /*****************************************************************************/
  358.  
  359. pascal    OSErr    GetVolumeInfoNoName(ConstStr255Param pathname,
  360.                                     short vRefNum,
  361.                                     HParmBlkPtr pb);
  362. /*    ヲ Call PBHGetVInfoSync ignoring returned name.
  363.     GetVolumeInfoNoName uses pathname and vRefNum to call PBHGetVInfoSync
  364.     in cases where the returned volume name is not needed by the caller.
  365.     The pathname and vRefNum parameters are not touched, and the pb
  366.     parameter is initialized by PBHGetVInfoSync except that ioNamePtr in
  367.     the parameter block is always returned as NULL (since it might point
  368.     to GetVolumeInfoNoName's local variable tempPathname).
  369.  
  370.     I noticed using this code in several places, so here it is once.
  371.     This reduces the code size of MoreFiles.
  372.  
  373.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  374.                         partial pathname, it is ignored. A full pathname to a
  375.                         volume must end with a colon character (:).
  376.     vRefNum        input:    Volume specification (volume reference number, working
  377.                         directory number, drive number, or 0).
  378.     pb            input:    A pointer to HParamBlockRec.
  379.                 output:    The parameter block as filled in by PBHGetVInfoSync
  380.                         except that ioNamePtr will always be NULL.
  381.     
  382.     Result Codes
  383.         noErr                0        No error
  384.         nsvErr                -35        No such volume
  385.         paramErr            -50        No default volume, or pb was NULL
  386. */
  387.  
  388. /*****************************************************************************/
  389.  
  390. pascal    OSErr    XGetVolumeInfoNoName(ConstStr255Param pathname,
  391.                                     short vRefNum,
  392.                                     XVolumeParamPtr pb);
  393. /*    ヲ Call PBXGetVolInfoSync ignoring returned name.
  394.     XGetVolumeInfoNoName uses pathname and vRefNum to call PBXGetVolInfoSync
  395.     in cases where the returned volume name is not needed by the caller.
  396.     The pathname and vRefNum parameters are not touched, and the pb
  397.     parameter is initialized by PBXGetVolInfoSync except that ioNamePtr in
  398.     the parameter block is always returned as NULL (since it might point
  399.     to XGetVolumeInfoNoName's local variable tempPathname).
  400.  
  401.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  402.                         partial pathname, it is ignored. A full pathname to a
  403.                         volume must end with a colon character (:).
  404.     vRefNum        input:    Volume specification (volume reference number, working
  405.                         directory number, drive number, or 0).
  406.     pb            input:    A pointer to HParamBlockRec.
  407.                 output:    The parameter block as filled in by PBXGetVolInfoSync
  408.                         except that ioNamePtr will always be NULL.
  409.     
  410.     Result Codes
  411.         noErr                0        No error
  412.         nsvErr                -35        No such volume
  413.         paramErr            -50        No default volume, or pb was NULL
  414. */
  415.  
  416. /*****************************************************************************/
  417.  
  418. pascal    OSErr GetCatInfoNoName(short vRefNum,
  419.                                long dirID,
  420.                                ConstStr255Param name,
  421.                                CInfoPBPtr pb);
  422. /*    ヲ Call PBGetCatInfoSync ignoring returned name.
  423.     GetCatInfoNoName uses vRefNum, dirID and name to call PBGetCatInfoSync
  424.     in cases where the returned object is not needed by the caller.
  425.     The vRefNum, dirID and name parameters are not touched, and the pb
  426.     parameter is initialized by PBGetCatInfoSync except that ioNamePtr in
  427.     the parameter block is always returned as NULL (since it might point
  428.     to GetCatInfoNoName's local variable tempName).
  429.  
  430.     I noticed using this code in several places, so here it is once.
  431.     This reduces the code size of MoreFiles.
  432.  
  433.     vRefNum            input:    Volume specification.
  434.     dirID            input:    Directory ID.
  435.     name            input:    Pointer to object name, or nil when dirID
  436.                             specifies a directory that's the object.
  437.     pb                input:    A pointer to CInfoPBRec.
  438.                     output:    The parameter block as filled in by
  439.                             PBGetCatInfoSync except that ioNamePtr will
  440.                             always be NULL.
  441.     
  442.     Result Codes
  443.         noErr                0        No error
  444.         nsvErr                -35        No such volume
  445.         ioErr                -36        I/O error
  446.         bdNamErr            -37        Bad filename
  447.         fnfErr                -43        File not found
  448.         paramErr            -50        No default volume
  449.         dirNFErr            -120    Directory not found or incomplete pathname
  450.         afpAccessDenied        -5000    User does not have the correct access
  451.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  452.         
  453. */
  454.  
  455. /*****************************************************************************/
  456.  
  457. pascal    OSErr    DetermineVRefNum(ConstStr255Param pathname,
  458.                                  short vRefNum,
  459.                                  short *realVRefNum);
  460. /*    ヲ Determine the real volume reference number.
  461.     The DetermineVRefNum function determines the volume reference number of
  462.     a volume from a pathname, a volume specification, or a combination
  463.     of the two.
  464.     WARNING: Volume names on the Macintosh are *not* unique -- Multiple
  465.     mounted volumes can have the same name. For this reason, the use of a
  466.     volume name or full pathname to identify a specific volume may not
  467.     produce the results you expect.  If more than one volume has the same
  468.     name and a volume name or full pathname is used, the File Manager
  469.     currently uses the first volume it finds with a matching name in the
  470.     volume queue.
  471.  
  472.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  473.                         partial pathname, it is ignored. A full pathname to a
  474.                         volume must end with a colon character (:).
  475.     vRefNum        input:    Volume specification (volume reference number, working
  476.                         directory number, drive number, or 0).
  477.     realVRefNum    output:    The real volume reference number.
  478.     
  479.     Result Codes
  480.         noErr                0        No error
  481.         nsvErr                -35        No such volume
  482.         paramErr            -50        No default volume
  483. */
  484.  
  485. /*****************************************************************************/
  486.  
  487. pascal    OSErr    HGetVInfo(short volReference,
  488.                           StringPtr volName,
  489.                           short *vRefNum,
  490.                           unsigned long *freeBytes,
  491.                           unsigned long *totalBytes);
  492. /*    ヲ Get information about a mounted volume.
  493.     The HGetVInfo function returns the name, volume reference number,
  494.     available space (in bytes), and total space (in bytes) for the
  495.     specified volume. You can specify the volume by providing its drive
  496.     number, volume reference number, or 0 for the default volume.
  497.     This routine is compatible with volumes up to 4 gigabytes.
  498.     
  499.     volReference    input:    The drive number, volume reference number,
  500.                             or 0 for the default volume.
  501.     volName            input:    A pointer to a buffer (minimum Str27) where
  502.                             the volume name is to be returned or must
  503.                             be nil.
  504.                     output:    The volume name.
  505.     vRefNum            output:    The volume reference number.
  506.     freeBytes        output:    The number of free bytes on the volume.
  507.                             freeBytes is an unsigned long value.
  508.     totalBytes        output:    The total number of bytes on the volume.
  509.                             totalBytes is an unsigned long value.
  510.     
  511.     Result Codes
  512.         noErr                0        No error
  513.         nsvErr                -35        No such volume
  514.         paramErr            -50        No default volume
  515.     
  516.     __________
  517.     
  518.     Also see:    XGetVInfo
  519. */
  520.  
  521. /*****************************************************************************/
  522.  
  523. pascal    OSErr    XGetVInfo(short volReference,
  524.                           StringPtr volName,
  525.                           short *vRefNum,
  526.                           UnsignedWide *freeBytes,
  527.                           UnsignedWide *totalBytes);
  528. /*    ヲ Get extended information about a mounted volume.
  529.     The XGetVInfo function returns the name, volume reference number,
  530.     available space (in bytes), and total space (in bytes) for the
  531.     specified volume. You can specify the volume by providing its drive
  532.     number, volume reference number, or 0 for the default volume.
  533.     This routine is compatible with volumes up to 2 terabytes.
  534.     
  535.     volReference    input:    The drive number, volume reference number,
  536.                             or 0 for the default volume.
  537.     volName            input:    A pointer to a buffer (minimum Str27) where
  538.                             the volume name is to be returned or must
  539.                             be nil.
  540.                     output:    The volume name.
  541.     vRefNum            output:    The volume reference number.
  542.     freeBytes        output:    The number of free bytes on the volume.
  543.                             freeBytes is an UnsignedWide value.
  544.     totalBytes        output:    The total number of bytes on the volume.
  545.                             totalBytes is an UnsignedWide value.
  546.     
  547.     Result Codes
  548.         noErr                0        No error
  549.         nsvErr                -35        No such volume
  550.         paramErr            -50        No default volume
  551.     
  552.     __________
  553.     
  554.     Also see:    HGetVInfo
  555. */
  556.  
  557. /*****************************************************************************/
  558.  
  559. pascal    OSErr    CheckVolLock(ConstStr255Param pathname,
  560.                              short vRefNum);
  561. /*    ヲ Determine if a volume is locked.
  562.     The CheckVolLock function determines if a volume is locked - either by
  563.     hardware or by software. If CheckVolLock returns noErr, then the volume
  564.     is not locked.
  565.  
  566.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  567.                         partial pathname, it is ignored. A full pathname to a
  568.                         volume must end with a colon character (:).
  569.     vRefNum        input:    Volume specification (volume reference number, working
  570.                         directory number, drive number, or 0).
  571.     
  572.     Result Codes
  573.         noErr                0        No error - volume not locked
  574.         nsvErr                -35        No such volume
  575.         wPrErr                -44        Volume locked by hardware
  576.         vLckdErr            -46        Volume locked by software
  577.         paramErr            -50        No default volume
  578. */
  579.  
  580. /*****************************************************************************/
  581.  
  582. pascal    OSErr GetDriverName(short driverRefNum,
  583.                             Str255 driverName);
  584. /*    ヲ Get a device driver's name.
  585.     The GetDriverName function returns a device driver's name.
  586.  
  587.     driverRefNum    input:    The driver reference number.
  588.     driverName        output:    The driver's name.
  589.     
  590.     Result Codes
  591.         noErr                0        No error
  592.         badUnitErr            -21        Bad driver reference number
  593. */
  594.  
  595. /*****************************************************************************/
  596.  
  597. pascal    OSErr    FindDrive(ConstStr255Param pathname,
  598.                           short vRefNum,
  599.                           DrvQElPtr *driveQElementPtr);
  600. /*    ヲ Find a volume's drive queue element in the drive queue.
  601.     The FindDrive function returns a pointer to a mounted volume's
  602.     drive queue element.
  603.  
  604.     pathName            input:    Pointer to a full pathname or nil. If you
  605.                                 pass in a partial pathname, it is ignored.
  606.                                 A full pathname to a volume must end with
  607.                                 a colon character (:).
  608.     vRefNum                input:    Volume specification (volume reference
  609.                                 number, working directory number, drive
  610.                                 number, or 0).
  611.     driveQElementPtr    output:    Pointer to a volume's drive queue element
  612.                                 in the drive queue. DO NOT change the
  613.                                 DrvQEl.
  614.     
  615.     Result Codes
  616.         noErr                0        No error
  617.         nsvErr                -35        No such volume
  618.         paramErr            -50        No default volume
  619.         nsDrvErr            -56        No such drive
  620. */
  621.  
  622. /*****************************************************************************/
  623.  
  624. pascal    OSErr    GetDiskBlocks(ConstStr255Param pathname,
  625.                               short vRefNum,
  626.                               unsigned long *numBlocks);
  627. /*    ヲ Return the number of physical disk blocks on a disk drive.
  628.     The GetDiskBlocks function returns the number of physical disk
  629.     blocks on a disk drive. NOTE: This is not the same as volume
  630.     allocation blocks!
  631.  
  632.     pathName    input:    Pointer to a full pathname or nil. If you
  633.                         pass in a partial pathname, it is ignored.
  634.                         A full pathname to a volume must end with
  635.                         a colon character (:).
  636.     vRefNum        input:    Volume specification (volume reference
  637.                         number, working directory number, drive
  638.                         number, or 0).
  639.     numBlocks    output:    The number of physical disk blocks on the disk drive.
  640.     
  641.     Result Codes
  642.         noErr                0        No error
  643.         nsvErr                -35        No such volume
  644.         paramErr            -50        No default volume, driver reference
  645.                                     number is zero, ReturnFormatList
  646.                                     returned zero blocks, DriveStatus
  647.                                     returned an unknown value, or
  648.                                     driveQElementPtr->qType is unknown
  649.         nsDrvErr            -56        No such drive
  650.         statusErr            ミ18        Driver does not respond to this
  651.                                     status request
  652.         badUnitErr            ミ21        Driver reference number does not
  653.                                     match unit table
  654.         unitEmptyErr        ミ22        Driver reference number specifies
  655.                                     a nil handle in unit table
  656.         abortErr            ミ27        Request aborted by KillIO
  657.         notOpenErr            ミ28        Driver not open
  658. */
  659.  
  660. /*****************************************************************************/
  661.  
  662. pascal    OSErr    GetVolFileSystemID(ConstStr255Param pathname,
  663.                                    short vRefNum,
  664.                                    short *fileSystemID);
  665. /*    ヲ Get a volume's file system ID.
  666.     The GetVolFileSystemID function returned the file system ID of
  667.     a mounted volume. The file system ID identifies the file system
  668.     that handles requests to a particular volume. Here's a partial list
  669.     of file system ID numbers (only Apple's file systems are listed):
  670.         FSID    File System
  671.         -----   -----------------------------------------------------
  672.         $0000    Macintosh HFS or MFS
  673.         $0100    ProDOS File System
  674.         $0101    PowerTalk Mail Enclosures
  675.         $4147    ISO 9660 File Access (through Foreign File Access)
  676.         $4242    High Sierra File Access (through Foreign File Access)
  677.         $464D    QuickTake File System (through Foreign File Access)
  678.         $4953    Macintosh PC Exchange (MS-DOS)
  679.         $4A48    Audio CD Access (through Foreign File Access)
  680.         $4D4B    Apple Photo Access (through Foreign File Access)
  681.     
  682.     See the Technical Note "FL 35 - Determining Which File System
  683.     Is Active" and the "Guide to the File System Manager" for more
  684.     information.
  685.     
  686.     pathName        input:    Pointer to a full pathname or nil.  If you pass
  687.                             in a partial pathname, it is ignored. A full
  688.                             pathname to a volume must contain at least
  689.                             one colon character (:) and must not start with
  690.                             a colon character.
  691.     vRefNum            input:    Volume specification (volume reference number,
  692.                             working directory number, drive number, or 0).
  693.     fileSystemID    output:    The volume's file system ID.
  694.     
  695.     Result Codes
  696.         noErr                0        No error
  697.         nsvErr                -35        No such volume
  698.         paramErr            -50        No default volume, or pb was NULL
  699. */
  700.  
  701. /*****************************************************************************/
  702.  
  703. pascal    OSErr    GetVolState(ConstStr255Param pathname,
  704.                             short vRefNum,
  705.                             Boolean *volumeOnline,
  706.                             Boolean *volumeEjected,
  707.                             Boolean *driveEjectable,
  708.                             Boolean *driverWantsEject);
  709. /*    ヲ Returns a volume's online and eject information.
  710.     The GetVolState function determines if a volume is online or offline,
  711.     if an offline volume is ejected, and if the volume's driver is
  712.     ejectable or wants eject calls.
  713.     
  714.     pathName            input:    Pointer to a full pathname or nil.
  715.     vRefNum                input:    Volume specification (volume reference number,
  716.                                 working directory number, drive number, or 0).
  717.     volumeOnline        output:    True if the volume is online;
  718.                                 False if the volume is offline.
  719.     volumeEjected        output:    True if the volume is ejected (ejected
  720.                                 volumes are always offline); False if the
  721.                                 volume is not ejected.
  722.     driveEjectable        output:    True if the volume's drive is ejectable;
  723.                                 False if the volume's drive is not ejectable.
  724.     driverWantsEject    output:    True if the volume's driver wants an Eject
  725.                                 request after unmount (even if the drive
  726.                                 is not ejectable); False if the volume's
  727.                                 driver does not need an eject request.
  728.     
  729.     Result Codes
  730.         noErr                0        No error
  731.         nsvErr                -35        No such volume
  732.         paramErr            -50        No default volume, or pb was NULL
  733. */
  734.  
  735. /*****************************************************************************/
  736.  
  737. pascal    OSErr    UnmountAndEject(ConstStr255Param pathname,
  738.                                 short vRefNum);
  739. /*    ヲ Unmount and eject a volume.
  740.     The UnmountAndEject function unmounts and ejects a volume. The volume
  741.     is ejected only if it is ejectable and not already ejected.
  742.     
  743.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  744.                         partial pathname, it is ignored. A full pathname to a
  745.                         volume must end with a colon character (:).
  746.     vRefNum        input:    Volume specification (volume reference number, working
  747.                         directory number, drive number, or 0).
  748.     
  749.     Result Codes
  750.         noErr                0        No error
  751.         nsvErr                -35        No such volume
  752.         ioErr                -36        I/O error
  753.         bdNamErr            -37        Bad volume name
  754.         fBsyErr                -47        One or more files are open
  755.         paramErr            -50        No default volume
  756.         nsDrvErr            -56        No such drive
  757.         extFSErr            -58        External file system error - no file
  758.                                     system claimed this call.
  759. */
  760.  
  761. /*****************************************************************************/
  762.  
  763. pascal    OSErr    OnLine(FSSpecPtr volumes,
  764.                        short reqVolCount,
  765.                        short *actVolCount,
  766.                        short *volIndex);
  767. /*    ヲ Return the list of volumes currently mounted.
  768.     The OnLine function returns the list of volumes currently mounted in
  769.     an array of FSSpec records.
  770.     
  771.     A noErr result indicates that the volumes array was filled
  772.     (actVolCount == reqVolCount) and there may be additional volumes
  773.     mounted. A nsvErr result indicates that the end of the volume list
  774.     was found and actVolCount volumes were actually found this time.
  775.  
  776.     volumes        input:    Pointer to array of FSSpec where the volume list
  777.                         is returned.
  778.     reqVolCount    input:    Maximum number of volumes to return    (the number of
  779.                         elements in the volumes array).
  780.     actVolCount    output: The number of volumes actually returned.
  781.     volIndex    input:    The current volume index position. Set to 1 to
  782.                         start with the first volume.
  783.                 output:    The volume index position to get the next volume.
  784.                         Pass this value the next time you call OnLine to
  785.                         start where you left off.
  786.     
  787.     Result Codes
  788.         noErr                0        No error, but there are more volumes
  789.                                     to list
  790.         nsvErr                -35        No more volumes to be listed
  791.         paramErr            -50        volIndex was <= 0
  792. */
  793.  
  794. /*****************************************************************************/
  795.  
  796. pascal    OSErr SetDefault(short newVRefNum,
  797.                          long newDirID,
  798.                          short *oldVRefNum,
  799.                          long *oldDirID);
  800. /*    ヲ Set the default volume before making Standard I/O requests.
  801.     The SetDefault function sets the default volume and directory to the
  802.     volume specified by newVRefNum and the directory specified by newDirID.
  803.     The current default volume reference number and directory ID are
  804.     returned in oldVRefNum and oldDir and must be used to restore the
  805.     default volume and directory to their previous state *as soon as
  806.     possible* with the RestoreDefault function. These two functions are
  807.     designed to be used as a wrapper around Standard I/O routines where
  808.     the location of the file is implied to be the default volume and
  809.     directory. In other words, this is how you should use these functions:
  810.     
  811.         error = SetDefault(newVRefNum, newDirID, &oldVRefNum, &oldDirID);
  812.         if ( error == noErr )
  813.         {
  814.             // call the Stdio functions like remove, rename, tmpfile,
  815.             // fopen, freopen, etc. or non-ANSI extensions like
  816.             // fdopen,fsetfileinfo, -- create, open, unlink, etc. here!
  817.             
  818.             error = RestoreDefault(oldVRefNum, oldDirID);
  819.         }
  820.     
  821.     By using these functions as a wrapper, you won't need to open a working
  822.     directory (because SetDefault and RestoreDefault use HSetVol) and you
  823.     won't have to worry about the effects of using HSetVol (documented in
  824.     Technical Note "FL 11 - PBHSetVol is Dangerous" and in the
  825.     Inside Macintosh: Files book in the description of the HSetVol and 
  826.     PBHSetVol functions) because the default volume/directory is restored
  827.     before giving up control to code that might be affected by HSetVol.
  828.     
  829.     newVRefNum    input:    Volume specification (volume reference number,
  830.                         working directory number, drive number, or 0) of
  831.                         the new default volume.
  832.     newDirID    input:    Directory ID of the new default directory.
  833.     oldVRefNum    output: The volume specification to save for use with
  834.                         RestoreDefault.
  835.     oldDirID    output:    The directory ID to save for use with
  836.                         RestoreDefault.
  837.     
  838.     Result Codes
  839.         noErr                0        No error
  840.         nsvErr                -35        No such volume
  841.         bdNamErr            -37        Bad volume name
  842.         fnfErr                -43        Directory not found
  843.         paramErr            -50        No default volume
  844.         afpAccessDenied        -5000    User does not have access to the directory
  845.     
  846.     __________
  847.     
  848.     Also see:    RestoreDefault
  849. */
  850.  
  851. /*****************************************************************************/
  852.  
  853. pascal    OSErr RestoreDefault(short oldVRefNum,
  854.                              long oldDirID);
  855. /*    ヲ Restore the default volume after making Standard C I/O requests.
  856.     The RestoreDefault function restores the default volume and directory
  857.     to the volume specified by oldVRefNum and the directory specified by 
  858.     oldDirID. The oldVRefNum and oldDirID parameters were previously
  859.     obtained from the SetDefault function. These two functions are designed
  860.     to be used as a wrapper around Standard C I/O routines where the
  861.     location of the file is implied to be the default volume and directory.
  862.     In other words, this is how you should use these functions:
  863.     
  864.         error = SetDefault(newVRefNum, newDirID, &oldVRefNum, &oldDirID);
  865.         if ( error == noErr )
  866.         {
  867.             // call the Stdio functions like remove, rename, tmpfile,
  868.             // fopen, freopen, etc. or non-ANSI extensions like
  869.             // fdopen,fsetfileinfo, -- create, open, unlink, etc. here!
  870.             
  871.             error = RestoreDefault(oldVRefNum, oldDirID);
  872.         }
  873.     
  874.     By using these functions as a wrapper, you won't need to open a working
  875.     directory (because SetDefault and RestoreDefault use HSetVol) and you
  876.     won't have to worry about the effects of using HSetVol (documented in
  877.     Technical Note "FL 11 - PBHSetVol is Dangerous" and in the
  878.     Inside Macintosh: Files book in the description of the HSetVol and 
  879.     PBHSetVol functions) because the default volume/directory is restored
  880.     before giving up control to code that might be affected by HSetVol.
  881.     
  882.     oldVRefNum    input: The volume specification to restore.
  883.     oldDirID    input:    The directory ID to restore.
  884.     
  885.     Result Codes
  886.         noErr                0        No error
  887.         nsvErr                -35        No such volume
  888.         bdNamErr            -37        Bad volume name
  889.         fnfErr                -43        Directory not found
  890.         paramErr            -50        No default volume
  891.         rfNumErr            -51        Bad working directory reference number
  892.         afpAccessDenied        -5000    User does not have access to the directory
  893.     
  894.     __________
  895.     
  896.     Also see:    SetDefault
  897. */
  898.  
  899. /*****************************************************************************/
  900.  
  901. pascal    OSErr GetDInfo(short vRefNum,
  902.                        long dirID,
  903.                        ConstStr255Param name,
  904.                        DInfo *fndrInfo);
  905. /*    ヲ Get the finder information for a directory.
  906.     The GetDInfo function gets the finder information for a directory.
  907.  
  908.     vRefNum            input:    Volume specification.
  909.     dirID            input:    Directory ID.
  910.     name            input:    Pointer to object name, or nil when dirID
  911.                             specifies a directory that's the object.
  912.     fndrInfo        output:    If the object is a directory, then its DInfo.
  913.     
  914.     Result Codes
  915.         noErr                0        No error
  916.         nsvErr                -35        No such volume
  917.         ioErr                -36        I/O error
  918.         bdNamErr            -37        Bad filename
  919.         fnfErr                -43        File not found
  920.         paramErr            -50        No default volume
  921.         dirNFErr            -120    Directory not found or incomplete pathname
  922.         afpAccessDenied        -5000    User does not have the correct access
  923.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  924.         
  925.     __________
  926.     
  927.     Also see:    FSpGetDInfo, FSpGetFInfoCompat
  928. */
  929.  
  930. /*****************************************************************************/
  931.  
  932. pascal    OSErr FSpGetDInfo(const FSSpec *spec,
  933.                           DInfo *fndrInfo);
  934. /*    ヲ Get the finder information for a directory.
  935.     The FSpGetDInfo function gets the finder information for a directory.
  936.  
  937.     spec        input:    An FSSpec record specifying the directory.
  938.     fndrInfo    output:    If the object is a directory, then its DInfo.
  939.     
  940.     Result Codes
  941.         noErr                0        No error
  942.         nsvErr                -35        No such volume
  943.         ioErr                -36        I/O error
  944.         bdNamErr            -37        Bad filename
  945.         fnfErr                -43        File not found
  946.         paramErr            -50        No default volume
  947.         dirNFErr            -120    Directory not found or incomplete pathname
  948.         afpAccessDenied        -5000    User does not have the correct access
  949.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  950.         
  951.     __________
  952.     
  953.     Also see:    FSpGetFInfoCompat, GetDInfo
  954. */
  955.  
  956. /*****************************************************************************/
  957.  
  958. pascal    OSErr SetDInfo(short vRefNum,
  959.                        long dirID,
  960.                        ConstStr255Param name,
  961.                        const DInfo *fndrInfo);
  962. /*    ヲ Set the finder information for a directory.
  963.     The SetDInfo function sets the finder information for a directory.
  964.  
  965.     vRefNum            input:    Volume specification.
  966.     dirID            input:    Directory ID.
  967.     name            input:    Pointer to object name, or nil when dirID
  968.                             specifies a directory that's the object.
  969.     fndrInfo        input:    The DInfo.
  970.     
  971.     Result Codes
  972.         noErr                0        No error
  973.         nsvErr                -35        No such volume
  974.         ioErr                -36        I/O error
  975.         bdNamErr            -37        Bad filename
  976.         fnfErr                -43        File not found
  977.         fLckdErr            -45        File is locked
  978.         vLckdErr            -46        Volume is locked or read-only
  979.         paramErr            -50        No default volume
  980.         dirNFErr            -120    Directory not found or incomplete pathname
  981.         afpAccessDenied        -5000    User does not have the correct access
  982.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  983.     
  984.     __________
  985.     
  986.     Also see:    FSpSetDInfo, FSpSetFInfoCompat
  987. */
  988.  
  989. /*****************************************************************************/
  990.  
  991. pascal    OSErr FSpSetDInfo(const FSSpec *spec,
  992.                           const DInfo *fndrInfo);
  993. /*    ヲ Set the finder information for a directory.
  994.     The FSpSetDInfo function sets the finder information for a directory.
  995.  
  996.     spec        input:    An FSSpec record specifying the directory.
  997.     fndrInfo    input:    The DInfo.
  998.     
  999.     Result Codes
  1000.         noErr                0        No error
  1001.         nsvErr                -35        No such volume
  1002.         ioErr                -36        I/O error
  1003.         bdNamErr            -37        Bad filename
  1004.         fnfErr                -43        File not found
  1005.         fLckdErr            -45        File is locked
  1006.         vLckdErr            -46        Volume is locked or read-only
  1007.         paramErr            -50        No default volume
  1008.         dirNFErr            -120    Directory not found or incomplete pathname
  1009.         afpAccessDenied        -5000    User does not have the correct access
  1010.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1011.     
  1012.     __________
  1013.     
  1014.     Also see:    FSpSetFInfoCompat, SetDInfo
  1015. */
  1016.  
  1017. /*****************************************************************************/
  1018.  
  1019. #if OLDROUTINENAMES
  1020. #define    GetDirID(vRefNum, dirID, name, theDirID, isDirectory)    ¥
  1021.         GetDirectoryID(vRefNum, dirID, name, theDirID, isDirectory)
  1022. #endif
  1023.  
  1024. pascal    OSErr    GetDirectoryID(short vRefNum,
  1025.                                long dirID,
  1026.                                ConstStr255Param name,
  1027.                                long *theDirID,
  1028.                                Boolean *isDirectory);
  1029. /*    ヲ Get the directory ID number of the directory specified.
  1030.     The GetDirectoryID function gets the directory ID number of the
  1031.     directory specified.  If a file is specified, then the parent
  1032.     directory of the file is returned and isDirectory is false.  If
  1033.     a directory is specified, then that directory's ID number is
  1034.     returned and isDirectory is true.
  1035.     WARNING: Volume names on the Macintosh are *not* unique -- Multiple
  1036.     mounted volumes can have the same name. For this reason, the use of a
  1037.     volume name or full pathname to identify a specific volume may not
  1038.     produce the results you expect.  If more than one volume has the same
  1039.     name and a volume name or full pathname is used, the File Manager
  1040.     currently uses the first volume it finds with a matching name in the
  1041.     volume queue.
  1042.     
  1043.     vRefNum            input:    Volume specification.
  1044.     dirID            input:    Directory ID.
  1045.     name            input:    Pointer to object name, or nil when dirID
  1046.                             specifies a directory that's the object.
  1047.     theDirID        output:    If the object is a file, then its parent directory
  1048.                             ID. If the object is a directory, then its ID.
  1049.     isDirectory        output:    True if object is a directory; false if
  1050.                             object is a file.
  1051.     
  1052.     Result Codes
  1053.         noErr                0        No error
  1054.         nsvErr                -35        No such volume
  1055.         ioErr                -36        I/O error
  1056.         bdNamErr            -37        Bad filename
  1057.         fnfErr                -43        File not found
  1058.         paramErr            -50        No default volume
  1059.         dirNFErr            -120    Directory not found or incomplete pathname
  1060.         afpAccessDenied        -5000    User does not have the correct access
  1061.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1062. */
  1063.  
  1064. /*****************************************************************************/
  1065.  
  1066. #if OLDROUTINENAMES
  1067. #define    DirIDFromFSSpec(spec, theDirID, isDirectory)    ¥
  1068.         FSpGetDirectoryID(spec, theDirID, isDirectory)
  1069. #endif
  1070.  
  1071. pascal    OSErr    FSpGetDirectoryID(const FSSpec *spec,
  1072.                                   long *theDirID,
  1073.                                   Boolean *isDirectory);
  1074. /*    ヲ Get the directory ID number of a directory.
  1075.     The FSpGetDirectoryID function gets the directory ID number of the
  1076.     directory specified by spec. If spec is to a file, then the parent
  1077.     directory of the file is returned and isDirectory is false.  If
  1078.     spec is to a directory, then that directory's ID number is
  1079.     returned and isDirectory is true.
  1080.     
  1081.     spec            input:    An FSSpec record specifying the directory.
  1082.     theDirID        output:    The directory ID.
  1083.     isDirectory        output:    True if object is a directory; false if
  1084.                             object is a file.
  1085.     
  1086.     Result Codes
  1087.         noErr                0        No error
  1088.         nsvErr                -35        No such volume
  1089.         ioErr                -36        I/O error
  1090.         bdNamErr            -37        Bad filename
  1091.         fnfErr                -43        File not found
  1092.         paramErr            -50        No default volume
  1093.         dirNFErr            -120    Directory not found or incomplete pathname
  1094.         afpAccessDenied        -5000    User does not have the correct access
  1095.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1096. */
  1097.  
  1098. /*****************************************************************************/
  1099.  
  1100. pascal    OSErr    GetDirName(short vRefNum,
  1101.                            long dirID,
  1102.                            Str31 name);
  1103. /*    ヲ Get the name of a directory from its directory ID.
  1104.     The GetDirName function gets the name of a directory from its
  1105.     directory ID.
  1106.  
  1107.     vRefNum        input:    Volume specification.
  1108.     dirID        input:    Directory ID.
  1109.     name        output:    Points to a Str31 where the directory name is to be
  1110.                         returned.
  1111.     
  1112.     Result Codes
  1113.         noErr                0        No error
  1114.         nsvErr                -35        No such volume
  1115.         ioErr                -36        I/O error
  1116.         bdNamErr            -37        Bad filename
  1117.         fnfErr                -43        File not found
  1118.         paramErr            -50        No default volume or
  1119.                                     name parameter was NULL
  1120.         dirNFErr            -120    Directory not found or incomplete pathname
  1121.         afpAccessDenied        -5000    User does not have the correct access
  1122.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1123. */
  1124.  
  1125. /*****************************************************************************/
  1126.  
  1127. pascal    OSErr    GetIOACUser(short vRefNum,
  1128.                             long dirID,
  1129.                             ConstStr255Param name,
  1130.                             SInt8 *ioACUser);
  1131. /*    ヲ Get a directory's access restrictions byte.
  1132.     GetIOACUser returns a directory's access restrictions byte.
  1133.     Use the masks and macro defined in MoreFilesExtras to check for
  1134.     specific access priviledges.
  1135.     
  1136.     vRefNum        input:    Volume specification.
  1137.     dirID        input:    Directory ID.
  1138.     name        input:    Pointer to object name, or nil when dirID
  1139.                         specifies a directory that's the object.
  1140.     ioACUser    output:    The access restriction byte
  1141.     
  1142.     Result Codes
  1143.         noErr                0        No error
  1144.         nsvErr                -35        No such volume
  1145.         ioErr                -36        I/O error
  1146.         bdNamErr            -37        Bad filename
  1147.         fnfErr                -43        File not found
  1148.         paramErr            -50        No default volume
  1149.         dirNFErr            -120    Directory not found or incomplete pathname
  1150.         afpAccessDenied        -5000    User does not have the correct access
  1151.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1152. */
  1153.  
  1154. /*****************************************************************************/
  1155.  
  1156. pascal    OSErr    FSpGetIOACUser(const FSSpec *spec,
  1157.                                SInt8 *ioACUser);
  1158. /*    ヲ Get a directory's access restrictions byte.
  1159.     FSpGetIOACUser returns a directory's access restrictions byte.
  1160.     Use the masks and macro defined in MoreFilesExtras to check for
  1161.     specific access priviledges.
  1162.     
  1163.     spec        input:    An FSSpec record specifying the directory.
  1164.     ioACUser    output:    The access restriction byte
  1165.     
  1166.     Result Codes
  1167.         noErr                0        No error
  1168.         nsvErr                -35        No such volume
  1169.         ioErr                -36        I/O error
  1170.         bdNamErr            -37        Bad filename
  1171.         fnfErr                -43        File not found
  1172.         paramErr            -50        No default volume
  1173.         dirNFErr            -120    Directory not found or incomplete pathname
  1174.         afpAccessDenied        -5000    User does not have the correct access
  1175.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1176. */
  1177.  
  1178. /*****************************************************************************/
  1179.  
  1180. pascal    OSErr    GetParentID(short vRefNum,
  1181.                             long dirID,
  1182.                             ConstStr255Param name,
  1183.                             long *parID);
  1184. /*    ヲ Get the parent directory ID number of the specified object.
  1185.     The GetParentID function gets the parent directory ID number of the
  1186.     specified object.
  1187.     
  1188.     vRefNum        input:    Volume specification.
  1189.     dirID        input:    Directory ID.
  1190.     name        input:    Pointer to object name, or nil when dirID specifies
  1191.                         a directory that's the object.
  1192.     parID        output:    The parent directory ID of the specified object.
  1193.     
  1194.     Result Codes
  1195.         noErr                0        No error
  1196.         nsvErr                -35        No such volume
  1197.         ioErr                -36        I/O error
  1198.         bdNamErr            -37        Bad filename
  1199.         fnfErr                -43        File not found
  1200.         paramErr            -50        No default volume
  1201.         dirNFErr            -120    Directory not found or incomplete pathname
  1202.         afpAccessDenied        -5000    User does not have the correct access
  1203.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1204. */
  1205.  
  1206. /*****************************************************************************/
  1207.  
  1208. pascal    OSErr    GetFilenameFromPathname(ConstStr255Param pathname,
  1209.                                         Str255 filename);
  1210. /*    ヲ Get the object name from the end of a full or partial pathname.
  1211.     The GetFilenameFromPathname function gets the file (or directory) name
  1212.     from the end of a full or partial pathname. Returns notAFileErr if the
  1213.     pathname is nil, the pathname is empty, or the pathname cannot refer to
  1214.     a filename (with a noErr result, the pathname could still refer to a
  1215.     directory).
  1216.     
  1217.     pathname    input:    A full or partial pathname.
  1218.     filename    output:    The file (or directory) name.
  1219.     
  1220.     Result Codes
  1221.         noErr                0        No error
  1222.         notAFileErr            -1302    The pathname is nil, the pathname
  1223.                                     is empty, or the pathname cannot refer
  1224.                                     to a filename
  1225.     
  1226.     __________
  1227.     
  1228.     See also:    GetObjectLocation.
  1229. */
  1230.  
  1231. /*****************************************************************************/
  1232.  
  1233. pascal    OSErr    GetObjectLocation(short vRefNum,
  1234.                                   long dirID,
  1235.                                   ConstStr255Param pathname,
  1236.                                   short *realVRefNum,
  1237.                                   long *realParID,
  1238.                                   Str255 realName,
  1239.                                   Boolean *isDirectory);
  1240. /*    ヲ Get a file system object's location.
  1241.     The GetObjectLocation function gets a file system object's location -
  1242.     that is, its real volume reference number, real parent directory ID,
  1243.     and name. While we're at it, determine if the object is a file or directory.
  1244.     If GetObjectLocation returns fnfErr, then the location information
  1245.     returned is valid, but it describes an object that doesn't exist.
  1246.     You can use the location information for another operation, such as
  1247.     creating a file or directory.
  1248.     
  1249.     vRefNum        input:    Volume specification.
  1250.     dirID        input:    Directory ID.
  1251.     pathname    input:    Pointer to object name, or nil when dirID specifies
  1252.                         a directory that's the object.
  1253.     realVRefNum    output:    The real volume reference number.
  1254.     realParID    output:    The parent directory ID of the specified object.
  1255.     realName    output:    The name of the specified object (the case of the
  1256.                         object name may not be the same as the object's
  1257.                         catalog entry on disk - since the Macintosh file
  1258.                         system is not case sensitive, it shouldn't matter).
  1259.     isDirectory    output:    True if object is a directory; false if object
  1260.                         is a file.
  1261.     
  1262.     Result Codes
  1263.         noErr                0        No error
  1264.         nsvErr                -35        No such volume
  1265.         ioErr                -36        I/O error
  1266.         bdNamErr            -37        Bad filename
  1267.         fnfErr                -43        File not found
  1268.         paramErr            -50        No default volume
  1269.         dirNFErr            -120    Directory not found or incomplete pathname
  1270.         notAFileErr            -1302    The pathname is nil, the pathname
  1271.                                     is empty, or the pathname cannot refer
  1272.                                     to a filename
  1273.         afpAccessDenied        -5000    User does not have the correct access
  1274.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1275.     
  1276.     __________
  1277.     
  1278.     See also:    FSMakeFSSpecCompat
  1279. */
  1280.  
  1281. /*****************************************************************************/
  1282.  
  1283. pascal    OSErr    GetDirItems(short vRefNum,
  1284.                             long dirID,
  1285.                             ConstStr255Param name,
  1286.                             Boolean getFiles,
  1287.                             Boolean getDirectories,
  1288.                             FSSpecPtr items,
  1289.                             short reqItemCount,
  1290.                             short *actItemCount,
  1291.                             short *itemIndex);
  1292. /*    ヲ Return a list of items in a directory.
  1293.     The GetDirItems function returns a list of items in the specified
  1294.     directory in an array of FSSpec records. File, subdirectories, or
  1295.     both can be returned in the list.
  1296.     
  1297.     A noErr result indicates that the items array was filled
  1298.     (actItemCount == reqItemCount) and there may be additional items
  1299.     left in the directory. A fnfErr result indicates that the end of
  1300.     the directory list was found and actItemCount items were actually
  1301.     found this time.
  1302.  
  1303.     vRefNum            input:    Volume specification.
  1304.     dirID            input:    Directory ID.
  1305.     name            input:    Pointer to object name, or nil when dirID
  1306.                             specifies a directory that's the object.
  1307.     getFiles        input:    Pass true to have files added to the items list.
  1308.     getDirectories    input:    Pass true to have directories added to the
  1309.                             items list.
  1310.     items            input:    Pointer to array of FSSpec where the item list
  1311.                             is returned.
  1312.     reqItemCount    input:    Maximum number of items to return (the number
  1313.                             of elements in the items array).
  1314.     actItemCount    output: The number of items actually returned.
  1315.     itemIndex        input:    The current item index position. Set to 1 to
  1316.                             start with the first item in the directory.
  1317.                     output:    The item index position to get the next item.
  1318.                             Pass this value the next time you call
  1319.                             GetDirItems to start where you left off.
  1320.     
  1321.     Result Codes
  1322.         noErr                0        No error, but there are more items
  1323.                                     to list
  1324.         nsvErr                -35        No such volume
  1325.         ioErr                -36        I/O error
  1326.         bdNamErr            -37        Bad filename
  1327.         fnfErr                -43        File not found, there are no more items
  1328.                                     to be listed.
  1329.         paramErr            -50        No default volume or itemIndex was <= 0
  1330.         dirNFErr            -120    Directory not found or incomplete pathname
  1331.         afpAccessDenied        -5000    User does not have the correct access
  1332.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1333. */
  1334.  
  1335. /*****************************************************************************/
  1336.  
  1337. pascal    OSErr    DeleteDirectoryContents(short vRefNum,
  1338.                                          long dirID,
  1339.                                         ConstStr255Param name);
  1340. /*    ヲ Delete the contents of a directory.
  1341.     The DeleteDirectoryContents function deletes the contents of a directory.
  1342.     All files and subdirectories in the specified directory are deleted.
  1343.     If a locked file or directory is encountered, it is unlocked and then
  1344.     deleted.  If any unexpected errors are encountered,
  1345.     DeleteDirectoryContents quits and returns to the caller.
  1346.     
  1347.     vRefNum    input:    Volume specification.
  1348.     dirID    input:    Directory ID.
  1349.     name    input:    Pointer to directory name, or nil when dirID specifies
  1350.                     a directory that's the object.
  1351.     
  1352.     Result Codes
  1353.         noErr                0        No error
  1354.         nsvErr                -35        No such volume
  1355.         ioErr                -36        I/O error
  1356.         bdNamErr            -37        Bad filename
  1357.         fnfErr                -43        File not found
  1358.         wPrErr                -44        Hardware volume lock    
  1359.         fLckdErr            -45        File is locked    
  1360.         vLckdErr            -46        Software volume lock    
  1361.         fBsyErr                -47        File busy, directory not empty, or working directory control block open    
  1362.         paramErr            -50        No default volume
  1363.         dirNFErr            -120    Directory not found or incomplete pathname
  1364.         afpAccessDenied        -5000    User does not have the correct access
  1365.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1366.     
  1367.     __________
  1368.     
  1369.     Also see:    DeleteDirectory
  1370. */
  1371.  
  1372. /*****************************************************************************/
  1373.  
  1374. pascal    OSErr    DeleteDirectory(short vRefNum,
  1375.                                 long dirID,
  1376.                                 ConstStr255Param name);
  1377. /*    ヲ Delete a directory and its contents.
  1378.     The DeleteDirectory function deletes a directory and its contents.
  1379.     All files and subdirectories in the specified directory are deleted.
  1380.     If a locked file or directory is encountered, it is unlocked and then
  1381.     deleted.  After deleting the directories contents, the directory is
  1382.     deleted. If any unexpected errors are encountered, DeleteDirectory
  1383.     quits and returns to the caller.
  1384.     
  1385.     vRefNum    input:    Volume specification.
  1386.     dirID    input:    Directory ID.
  1387.     name    input:    Pointer to directory name, or nil when dirID specifies
  1388.                     a directory that's the object.
  1389.     
  1390.     Result Codes
  1391.         noErr                0        No error
  1392.         nsvErr                -35        No such volume
  1393.         ioErr                -36        I/O error
  1394.         bdNamErr            -37        Bad filename
  1395.         fnfErr                -43        File not found
  1396.         wPrErr                -44        Hardware volume lock
  1397.         fLckdErr            -45        File is locked
  1398.         vLckdErr            -46        Software volume lock
  1399.         fBsyErr                -47        File busy, directory not empty, or working directory control block open    
  1400.         paramErr            -50        No default volume
  1401.         dirNFErr            -120    Directory not found or incomplete pathname
  1402.         afpAccessDenied        -5000    User does not have the correct access
  1403.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1404.     
  1405.     __________
  1406.     
  1407.     Also see:    DeleteDirectoryContents
  1408. */
  1409.  
  1410. /*****************************************************************************/
  1411.  
  1412. pascal    OSErr    CheckObjectLock(short vRefNum,
  1413.                                 long dirID,
  1414.                                 ConstStr255Param name);
  1415. /*    ヲ Determine if a file or directory is locked.
  1416.     The CheckObjectLock function determines if a file or directory is locked.
  1417.     If CheckObjectLock returns noErr, then the file or directory
  1418.     is not locked. If CheckObjectLock returns fLckdErr, the it is locked.
  1419.     
  1420.     vRefNum    input:    Volume specification.
  1421.     dirID    input:    Directory ID.
  1422.     name    input:    Pointer to object name, or nil when dirID specifies
  1423.                     a directory that's the object.
  1424.     
  1425.     Result Codes
  1426.         noErr                0        No error
  1427.         nsvErr                -35        No such volume
  1428.         ioErr                -36        I/O error
  1429.         bdNamErr            -37        Bad filename
  1430.         fnfErr                -43        File not found
  1431.         fLckdErr            -45        File is locked
  1432.         paramErr            -50        No default volume
  1433.         dirNFErr            -120    Directory not found or incomplete pathname
  1434.         afpAccessDenied        -5000    User does not have the correct access
  1435.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1436.     
  1437.     __________
  1438.     
  1439.     Also see:    FSpCheckObjectLock
  1440. */
  1441.  
  1442. /*****************************************************************************/
  1443.  
  1444. pascal    OSErr    FSpCheckObjectLock(const FSSpec *spec);
  1445. /*    ヲ Determine if a file or directory is locked.
  1446.     The FSpCheckObjectLock function determines if a file or directory is locked.
  1447.     If FSpCheckObjectLock returns noErr, then the file or directory
  1448.     is not locked.
  1449.     
  1450.     spec    input:    An FSSpec record specifying the object.
  1451.     
  1452.     Result Codes
  1453.         noErr                0        No error
  1454.         nsvErr                -35        No such volume
  1455.         ioErr                -36        I/O error
  1456.         bdNamErr            -37        Bad filename
  1457.         fnfErr                -43        File not found
  1458.         fLckdErr            -45        File is locked
  1459.         paramErr            -50        No default volume
  1460.         dirNFErr            -120    Directory not found or incomplete pathname
  1461.         afpAccessDenied        -5000    User does not have the correct access
  1462.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1463.     
  1464.     __________
  1465.     
  1466.     Also see:    CheckObjectLock
  1467. */
  1468.  
  1469. /*****************************************************************************/
  1470.  
  1471. pascal    OSErr    GetFileSize(short vRefNum,
  1472.                             long dirID,
  1473.                             ConstStr255Param fileName,
  1474.                             long *dataSize,
  1475.                             long *rsrcSize);
  1476. /*    ヲ Get the logical sizes of a file's forks.
  1477.     The GetFileSize function returns the logical size of a file's
  1478.     data and resource fork.
  1479.     
  1480.     vRefNum        input:    Volume specification.
  1481.     dirID        input:    Directory ID.
  1482.     name        input:    The name of the file.
  1483.     dataSize    output:    The number of bytes in the file's data fork.
  1484.     rsrcSize    output:    The number of bytes in the file's resource fork.
  1485.     
  1486.     Result Codes
  1487.         noErr                0        No error
  1488.         nsvErr                -35        No such volume
  1489.         ioErr                -36        I/O error
  1490.         bdNamErr            -37        Bad filename
  1491.         fnfErr                -43        File not found
  1492.         paramErr            -50        No default volume
  1493.         dirNFErrdirNFErr    -120    Directory not found or incomplete pathname
  1494.         afpAccessDenied        -5000    User does not have the correct access
  1495.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1496.     
  1497.     __________
  1498.     
  1499.     See also:    FSpGetFileSize
  1500. */
  1501.  
  1502. /*****************************************************************************/
  1503.  
  1504. pascal    OSErr    FSpGetFileSize(const FSSpec *spec,
  1505.                                long *dataSize,
  1506.                                long *rsrcSize);
  1507. /*    ヲ Get the logical sizes of a file's forks.
  1508.     The FSpGetFileSize function returns the logical size of a file's
  1509.     data and resource fork.
  1510.     
  1511.     spec        input:    An FSSpec record specifying the file.
  1512.     dataSize    output:    The number of bytes in the file's data fork.
  1513.     rsrcSize    output:    The number of bytes in the file's resource fork.
  1514.     
  1515.     Result Codes
  1516.         noErr                0        No error
  1517.         nsvErr                -35        No such volume
  1518.         ioErr                -36        I/O error
  1519.         bdNamErr            -37        Bad filename
  1520.         fnfErr                -43        File not found
  1521.         paramErr            -50        No default volume
  1522.         dirNFErrdirNFErr    -120    Directory not found or incomplete pathname
  1523.         afpAccessDenied        -5000    User does not have the correct access
  1524.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1525.     
  1526.     __________
  1527.     
  1528.     See also:    GetFileSize
  1529. */
  1530.  
  1531. /*****************************************************************************/
  1532.  
  1533. pascal    OSErr    BumpDate(short vRefNum,
  1534.                          long dirID,
  1535.                          ConstStr255Param name);
  1536. /*    ヲ Update the modification date of a file or directory.
  1537.     The BumpDate function changes the modification date of a file or
  1538.     directory to the current date/time.  If the modification date is already
  1539.     equal to the current date/time, then add one second to the
  1540.     modification date.
  1541.     
  1542.     vRefNum    input:    Volume specification.
  1543.     dirID    input:    Directory ID.
  1544.     name    input:    Pointer to object name, or nil when dirID specifies
  1545.                     a directory that's the object.
  1546.     
  1547.     Result Codes
  1548.         noErr                0        No error
  1549.         nsvErr                -35        No such volume
  1550.         ioErr                -36        I/O error
  1551.         bdNamErr            -37        Bad filename
  1552.         fnfErr                -43        File not found
  1553.         fLckdErr            -45        File is locked
  1554.         vLckdErr            -46        Volume is locked or read-only
  1555.         paramErr            -50        No default volume
  1556.         dirNFErr            -120    Directory not found or incomplete pathname
  1557.         afpAccessDenied        -5000    User does not have the correct access
  1558.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1559.     
  1560.     __________
  1561.     
  1562.     See also:    FSpBumpDate
  1563. */
  1564.  
  1565. /*****************************************************************************/
  1566.  
  1567. pascal    OSErr    FSpBumpDate(const FSSpec *spec);
  1568. /*    ヲ Update the modification date of a file or directory.
  1569.     The FSpBumpDate function changes the modification date of a file or
  1570.     directory to the current date/time.  If the modification date is already
  1571.     equal to the current date/time, then add one second to the
  1572.     modification date.
  1573.     
  1574.     spec    input:    An FSSpec record specifying the object.
  1575.     
  1576.     Result Codes
  1577.         noErr                0        No error
  1578.         nsvErr                -35        No such volume
  1579.         ioErr                -36        I/O error
  1580.         bdNamErr            -37        Bad filename
  1581.         fnfErr                -43        File not found
  1582.         fLckdErr            -45        File is locked
  1583.         vLckdErr            -46        Volume is locked or read-only
  1584.         paramErr            -50        No default volume
  1585.         dirNFErr            -120    Directory not found or incomplete pathname
  1586.         afpAccessDenied        -5000    User does not have the correct access
  1587.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1588.     
  1589.     __________
  1590.     
  1591.     See also:    BumpDate
  1592. */
  1593.  
  1594. /*****************************************************************************/
  1595.  
  1596. pascal    OSErr    ChangeCreatorType(short vRefNum,
  1597.                                   long dirID,
  1598.                                   ConstStr255Param name,
  1599.                                   OSType creator,
  1600.                                   OSType fileType);
  1601. /*    ヲ Change the creator or file type of a file.
  1602.     The ChangeCreatorType function changes the creator or file type of a file.
  1603.  
  1604.     vRefNum        input:    Volume specification.
  1605.     dirID        input:    Directory ID.
  1606.     name        input:    The name of the file.
  1607.     creator        input:    The new creator type or 0x00000000 to leave
  1608.                         the creator type alone.
  1609.     fileType    input:    The new file type or 0x00000000 to leave the
  1610.                         file type alone.
  1611.     
  1612.     Result Codes
  1613.         noErr                0        No error
  1614.         nsvErr                -35        No such volume
  1615.         ioErr                -36        I/O error
  1616.         bdNamErr            -37        Bad filename
  1617.         fnfErr                -43        File not found
  1618.         fLckdErr            -45        File is locked
  1619.         vLckdErr            -46        Volume is locked or read-only
  1620.         paramErr            -50        No default volume
  1621.         dirNFErr            -120    Directory not found or incomplete pathname
  1622.         notAFileErr            -1302    Name was not a file
  1623.         afpAccessDenied        -5000    User does not have the correct access
  1624.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1625.     
  1626.     __________
  1627.     
  1628.     See also:    FSpChangeCreatorType
  1629. */
  1630.  
  1631. /*****************************************************************************/
  1632.  
  1633. pascal    OSErr    FSpChangeCreatorType(const FSSpec *spec,
  1634.                                      OSType creator,
  1635.                                      OSType fileType);
  1636. /*    ヲ Change the creator or file type of a file.
  1637.     The FSpChangeCreatorType function changes the creator or file type of a file.
  1638.  
  1639.     spec        input:    An FSSpec record specifying the file.
  1640.     creator        input:    The new creator type or 0x00000000 to leave
  1641.                         the creator type alone.
  1642.     fileType    input:    The new file type or 0x00000000 to leave the
  1643.                         file type alone.
  1644.     
  1645.     Result Codes
  1646.         noErr                0        No error
  1647.         nsvErr                -35        No such volume
  1648.         ioErr                -36        I/O error
  1649.         bdNamErr            -37        Bad filename
  1650.         fnfErr                -43        File not found
  1651.         fLckdErr            -45        File is locked
  1652.         vLckdErr            -46        Volume is locked or read-only
  1653.         paramErr            -50        No default volume
  1654.         dirNFErr            -120    Directory not found or incomplete pathname
  1655.         notAFileErr            -1302    Name was not a file
  1656.         afpAccessDenied        -5000    User does not have the correct access
  1657.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1658.     
  1659.     __________
  1660.     
  1661.     See also:    ChangeCreatorType
  1662. */
  1663.  
  1664. /*****************************************************************************/
  1665.  
  1666. pascal    OSErr    ChangeFDFlags(short vRefNum,
  1667.                               long dirID,
  1668.                               ConstStr255Param name,
  1669.                               Boolean    setBits,
  1670.                               unsigned short flagBits);
  1671. /*    ヲ Set or clear Finder Flag bits.
  1672.     The ChangeFDFlags function sets or clears Finder Flag bits in the
  1673.     fdFlags field of a file or directory's FInfo record.
  1674.     
  1675.     vRefNum        input:    Volume specification.
  1676.     dirID        input:    Directory ID.
  1677.     name        input:    Pointer to object name, or nil when dirID specifies
  1678.                         a directory that's the object.
  1679.     setBits        input:    If true, then set the bits specified in flagBits.
  1680.                         If false, then clear the bits specified in flagBits.
  1681.     flagBits    input:    The flagBits parameter specifies which Finder Flag
  1682.                         bits to set or clear. If a bit in flagBits is set,
  1683.                         then the same bit in fdFlags is either set or
  1684.                         cleared depending on the state of the setBits
  1685.                         parameter.
  1686.     
  1687.     Result Codes
  1688.         noErr                0        No error
  1689.         nsvErr                -35        No such volume
  1690.         ioErr                -36        I/O error
  1691.         bdNamErr            -37        Bad filename
  1692.         fnfErr                -43        File not found
  1693.         fLckdErr            -45        File is locked
  1694.         vLckdErr            -46        Volume is locked or read-only
  1695.         paramErr            -50        No default volume
  1696.         dirNFErr            -120    Directory not found or incomplete pathname
  1697.         afpAccessDenied        -5000    User does not have the correct access
  1698.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1699.     
  1700.     __________
  1701.     
  1702.     See also:    FSpChangeFDFlags
  1703. */
  1704.  
  1705. /*****************************************************************************/
  1706.  
  1707. pascal    OSErr    FSpChangeFDFlags(const FSSpec *spec,
  1708.                                  Boolean setBits,
  1709.                                  unsigned short flagBits);
  1710. /*    ヲ Set or clear Finder Flag bits.
  1711.     The FSpChangeFDFlags function sets or clears Finder Flag bits in the
  1712.     fdFlags field of a file or directory's FInfo record.
  1713.     
  1714.     spec        input:    An FSSpec record specifying the object.
  1715.     setBits        input:    If true, then set the bits specified in flagBits.
  1716.                         If false, then clear the bits specified in flagBits.
  1717.     flagBits    input:    The flagBits parameter specifies which Finder Flag
  1718.                         bits to set or clear. If a bit in flagBits is set,
  1719.                         then the same bit in fdFlags is either set or
  1720.                         cleared depending on the state of the setBits
  1721.                         parameter.
  1722.     
  1723.     Result Codes
  1724.         noErr                0        No error
  1725.         nsvErr                -35        No such volume
  1726.         ioErr                -36        I/O error
  1727.         bdNamErr            -37        Bad filename
  1728.         fnfErr                -43        File not found
  1729.         fLckdErr            -45        File is locked
  1730.         vLckdErr            -46        Volume is locked or read-only
  1731.         paramErr            -50        No default volume
  1732.         dirNFErr            -120    Directory not found or incomplete pathname
  1733.         afpAccessDenied        -5000    User does not have the correct access
  1734.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1735.     
  1736.     __________
  1737.     
  1738.     See also:    ChangeFDFlags
  1739. */
  1740.  
  1741. /*****************************************************************************/
  1742.  
  1743. pascal    OSErr    SetIsInvisible(short vRefNum,
  1744.                                long dirID,
  1745.                                ConstStr255Param name);
  1746. /*    ヲ Set the invisible Finder Flag bit.
  1747.     The SetIsInvisible function sets the invisible bit in the fdFlags
  1748.     word of the specified file or directory's finder information.
  1749.     
  1750.     vRefNum    input:    Volume specification.
  1751.     dirID    input:    Directory ID.
  1752.     name    input:    Pointer to object name, or nil when dirID specifies
  1753.                     a directory that's the object.
  1754.     
  1755.     Result Codes
  1756.         noErr                0        No error
  1757.         nsvErr                -35        No such volume
  1758.         ioErr                -36        I/O error
  1759.         bdNamErr            -37        Bad filename
  1760.         fnfErr                -43        File not found
  1761.         fLckdErr            -45        File is locked
  1762.         vLckdErr            -46        Volume is locked or read-only
  1763.         paramErr            -50        No default volume
  1764.         dirNFErr            -120    Directory not found or incomplete pathname
  1765.         afpAccessDenied        -5000    User does not have the correct access
  1766.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1767.     
  1768.     __________
  1769.     
  1770.     See also:    FSpSetIsInvisible, ClearIsInvisible, FSpClearIsInvisible
  1771. */
  1772.  
  1773. /*****************************************************************************/
  1774.  
  1775. pascal    OSErr    FSpSetIsInvisible(const FSSpec *spec);
  1776. /*    ヲ Set the invisible Finder Flag bit.
  1777.     The FSpSetIsInvisible function sets the invisible bit in the fdFlags
  1778.     word of the specified file or directory's finder information.
  1779.     
  1780.     spec    input:    An FSSpec record specifying the object.
  1781.     
  1782.     Result Codes
  1783.         noErr                0        No error
  1784.         nsvErr                -35        No such volume
  1785.         ioErr                -36        I/O error
  1786.         bdNamErr            -37        Bad filename
  1787.         fnfErr                -43        File not found
  1788.         fLckdErr            -45        File is locked
  1789.         vLckdErr            -46        Volume is locked or read-only
  1790.         paramErr            -50        No default volume
  1791.         dirNFErr            -120    Directory not found or incomplete pathname
  1792.         afpAccessDenied        -5000    User does not have the correct access
  1793.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1794.     
  1795.     __________
  1796.     
  1797.     See also:    SetIsInvisible, ClearIsInvisible, FSpClearIsInvisible
  1798. */
  1799.  
  1800. /*****************************************************************************/
  1801.  
  1802. pascal    OSErr    ClearIsInvisible(short vRefNum,
  1803.                                  long dirID,
  1804.                                  ConstStr255Param name);
  1805. /*    ヲ Clear the invisible Finder Flag bit.
  1806.     The ClearIsInvisible function clears the invisible bit in the fdFlags
  1807.     word of the specified file or directory's finder information.
  1808.     
  1809.     vRefNum    input:    Volume specification.
  1810.     dirID    input:    Directory ID.
  1811.     name    input:    Pointer to object name, or nil when dirID specifies
  1812.                     a directory that's the object.
  1813.     
  1814.     Result Codes
  1815.         noErr                0        No error
  1816.         nsvErr                -35        No such volume
  1817.         ioErr                -36        I/O error
  1818.         bdNamErr            -37        Bad filename
  1819.         fnfErr                -43        File not found
  1820.         fLckdErr            -45        File is locked
  1821.         vLckdErr            -46        Volume is locked or read-only
  1822.         paramErr            -50        No default volume
  1823.         dirNFErr            -120    Directory not found or incomplete pathname
  1824.         afpAccessDenied        -5000    User does not have the correct access
  1825.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1826.     
  1827.     __________
  1828.     
  1829.     See also:    SetIsInvisible, FSpSetIsInvisible, FSpClearIsInvisible
  1830. */
  1831.  
  1832. /*****************************************************************************/
  1833.  
  1834. pascal    OSErr    FSpClearIsInvisible(const FSSpec *spec);
  1835. /*    ヲ Clear the invisible Finder Flag bit.
  1836.     The FSpClearIsInvisible function clears the invisible bit in the fdFlags
  1837.     word of the specified file or directory's finder information.
  1838.     
  1839.     spec    input:    An FSSpec record specifying the object.
  1840.     
  1841.     Result Codes
  1842.         noErr                0        No error
  1843.         nsvErr                -35        No such volume
  1844.         ioErr                -36        I/O error
  1845.         bdNamErr            -37        Bad filename
  1846.         fnfErr                -43        File not found
  1847.         fLckdErr            -45        File is locked
  1848.         vLckdErr            -46        Volume is locked or read-only
  1849.         paramErr            -50        No default volume
  1850.         dirNFErr            -120    Directory not found or incomplete pathname
  1851.         afpAccessDenied        -5000    User does not have the correct access
  1852.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1853.     
  1854.     __________
  1855.     
  1856.     See also:    SetIsInvisible, FSpSetIsInvisible, ClearIsInvisible
  1857. */
  1858.  
  1859. /*****************************************************************************/
  1860.  
  1861. pascal    OSErr    SetNameLocked(short vRefNum,
  1862.                               long dirID,
  1863.                               ConstStr255Param name);
  1864. /*    ヲ Set the nameLocked Finder Flag bit.
  1865.     The SetNameLocked function sets the nameLocked bit in the fdFlags word
  1866.     of the specified file or directory's finder information.
  1867.     
  1868.     vRefNum    input:    Volume specification.
  1869.     dirID    input:    Directory ID.
  1870.     name    input:    Pointer to object name, or nil when dirID specifies
  1871.                     a directory that's the object.
  1872.     
  1873.     Result Codes
  1874.         noErr                0        No error
  1875.         nsvErr                -35        No such volume
  1876.         ioErr                -36        I/O error
  1877.         bdNamErr            -37        Bad filename
  1878.         fnfErr                -43        File not found
  1879.         fLckdErr            -45        File is locked
  1880.         vLckdErr            -46        Volume is locked or read-only
  1881.         paramErr            -50        No default volume
  1882.         dirNFErr            -120    Directory not found or incomplete pathname
  1883.         afpAccessDenied        -5000    User does not have the correct access
  1884.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1885.     
  1886.     __________
  1887.     
  1888.     See also:    FSpSetNameLocked, ClearNameLocked, FSpClearNameLocked
  1889. */
  1890.  
  1891. /*****************************************************************************/
  1892.  
  1893. pascal    OSErr    FSpSetNameLocked(const FSSpec *spec);
  1894. /*    ヲ Set the nameLocked Finder Flag bit.
  1895.     The FSpSetNameLocked function sets the nameLocked bit in the fdFlags word
  1896.     of the specified file or directory's finder information.
  1897.     
  1898.     spec    input:    An FSSpec record specifying the object.
  1899.     
  1900.     Result Codes
  1901.         noErr                0        No error
  1902.         nsvErr                -35        No such volume
  1903.         ioErr                -36        I/O error
  1904.         bdNamErr            -37        Bad filename
  1905.         fnfErr                -43        File not found
  1906.         fLckdErr            -45        File is locked
  1907.         vLckdErr            -46        Volume is locked or read-only
  1908.         paramErr            -50        No default volume
  1909.         dirNFErr            -120    Directory not found or incomplete pathname
  1910.         afpAccessDenied        -5000    User does not have the correct access
  1911.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1912.     
  1913.     __________
  1914.     
  1915.     See also:    SetNameLocked, ClearNameLocked, FSpClearNameLocked
  1916. */
  1917.  
  1918. /*****************************************************************************/
  1919.  
  1920. pascal    OSErr    ClearNameLocked(short vRefNum,
  1921.                                 long dirID,
  1922.                                 ConstStr255Param name);
  1923. /*    ヲ Clear the nameLocked Finder Flag bit.
  1924.     The ClearNameLocked function clears the nameLocked bit in the fdFlags
  1925.     word of the specified file or directory's finder information.
  1926.     
  1927.     vRefNum    input:    Volume specification.
  1928.     dirID    input:    Directory ID.
  1929.     name    input:    Pointer to object name, or nil when dirID specifies
  1930.                     a directory that's the object.
  1931.     
  1932.     Result Codes
  1933.         noErr                0        No error
  1934.         nsvErr                -35        No such volume
  1935.         ioErr                -36        I/O error
  1936.         bdNamErr            -37        Bad filename
  1937.         fnfErr                -43        File not found
  1938.         fLckdErr            -45        File is locked
  1939.         vLckdErr            -46        Volume is locked or read-only
  1940.         paramErr            -50        No default volume
  1941.         dirNFErr            -120    Directory not found or incomplete pathname
  1942.         afpAccessDenied        -5000    User does not have the correct access
  1943.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1944.     
  1945.     __________
  1946.     
  1947.     See also:    SetNameLocked, FSpSetNameLocked, FSpClearNameLocked
  1948. */
  1949.  
  1950. /*****************************************************************************/
  1951.  
  1952. pascal    OSErr    FSpClearNameLocked(const FSSpec *spec);
  1953. /*    ヲ Clear the nameLocked Finder Flag bit.
  1954.     The FSpClearNameLocked function clears the nameLocked bit in the fdFlags
  1955.     word of the specified file or directory's finder information.
  1956.     
  1957.     spec    input:    An FSSpec record specifying the object.
  1958.     
  1959.     Result Codes
  1960.         noErr                0        No error
  1961.         nsvErr                -35        No such volume
  1962.         ioErr                -36        I/O error
  1963.         bdNamErr            -37        Bad filename
  1964.         fnfErr                -43        File not found
  1965.         fLckdErr            -45        File is locked
  1966.         vLckdErr            -46        Volume is locked or read-only
  1967.         paramErr            -50        No default volume
  1968.         dirNFErr            -120    Directory not found or incomplete pathname
  1969.         afpAccessDenied        -5000    User does not have the correct access
  1970.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1971.     
  1972.     __________
  1973.     
  1974.     See also:    SetNameLocked, FSpSetNameLocked, ClearNameLocked
  1975. */
  1976.  
  1977. /*****************************************************************************/
  1978.  
  1979. pascal    OSErr    SetIsStationery(short vRefNum,
  1980.                                 long dirID,
  1981.                                 ConstStr255Param name);
  1982. /*    ヲ Set the isStationery Finder Flag bit.
  1983.     The SetIsStationery function sets the isStationery bit in the
  1984.     fdFlags word of the specified file or directory's finder information.
  1985.     
  1986.     vRefNum    input:    Volume specification.
  1987.     dirID    input:    Directory ID.
  1988.     name    input:    Pointer to object name, or nil when dirID specifies
  1989.                     a directory that's the object.
  1990.     
  1991.     Result Codes
  1992.         noErr                0        No error
  1993.         nsvErr                -35        No such volume
  1994.         ioErr                -36        I/O error
  1995.         bdNamErr            -37        Bad filename
  1996.         fnfErr                -43        File not found
  1997.         fLckdErr            -45        File is locked
  1998.         vLckdErr            -46        Volume is locked or read-only
  1999.         paramErr            -50        No default volume
  2000.         dirNFErr            -120    Directory not found or incomplete pathname
  2001.         afpAccessDenied        -5000    User does not have the correct access
  2002.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2003.     
  2004.     __________
  2005.     
  2006.     See also:    FSpSetIsStationery, ClearIsStationery, FSpClearIsStationery
  2007. */
  2008.  
  2009. /*****************************************************************************/
  2010.  
  2011. pascal    OSErr    FSpSetIsStationery(const FSSpec *spec);
  2012. /*    ヲ Set the isStationery Finder Flag bit.
  2013.     The FSpSetIsStationery function sets the isStationery bit in the
  2014.     fdFlags word of the specified file or directory's finder information.
  2015.     
  2016.     spec    input:    An FSSpec record specifying the object.
  2017.     
  2018.     Result Codes
  2019.         noErr                0        No error
  2020.         nsvErr                -35        No such volume
  2021.         ioErr                -36        I/O error
  2022.         bdNamErr            -37        Bad filename
  2023.         fnfErr                -43        File not found
  2024.         fLckdErr            -45        File is locked
  2025.         vLckdErr            -46        Volume is locked or read-only
  2026.         paramErr            -50        No default volume
  2027.         dirNFErr            -120    Directory not found or incomplete pathname
  2028.         afpAccessDenied        -5000    User does not have the correct access
  2029.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2030.     
  2031.     __________
  2032.     
  2033.     See also:    SetIsStationery, ClearIsStationery, FSpClearIsStationery
  2034. */
  2035.  
  2036. /*****************************************************************************/
  2037.  
  2038. pascal    OSErr    ClearIsStationery(short vRefNum,
  2039.                                   long dirID,
  2040.                                   ConstStr255Param name);
  2041. /*    ヲ Clear the isStationery Finder Flag bit.
  2042.     The ClearIsStationery function clears the isStationery bit in the
  2043.     fdFlags word of the specified file or directory's finder information.
  2044.     
  2045.     vRefNum    input:    Volume specification.
  2046.     dirID    input:    Directory ID.
  2047.     name    input:    Pointer to object name, or nil when dirID specifies
  2048.                     a directory that's the object.
  2049.     
  2050.     Result Codes
  2051.         noErr                0        No error
  2052.         nsvErr                -35        No such volume
  2053.         ioErr                -36        I/O error
  2054.         bdNamErr            -37        Bad filename
  2055.         fnfErr                -43        File not found
  2056.         fLckdErr            -45        File is locked
  2057.         vLckdErr            -46        Volume is locked or read-only
  2058.         paramErr            -50        No default volume
  2059.         dirNFErr            -120    Directory not found or incomplete pathname
  2060.         afpAccessDenied        -5000    User does not have the correct access
  2061.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2062.     
  2063.     __________
  2064.     
  2065.     See also:    SetIsStationery, FSpSetIsStationery, FSpClearIsStationery
  2066. */
  2067.  
  2068. /*****************************************************************************/
  2069.  
  2070. pascal    OSErr    FSpClearIsStationery(const FSSpec *spec);
  2071. /*    ヲ Clear the isStationery Finder Flag bit.
  2072.     The FSpClearIsStationery function clears the isStationery bit in the
  2073.     fdFlags word of the specified file or directory's finder information.
  2074.     
  2075.     spec    input:    An FSSpec record specifying the object.
  2076.     
  2077.     Result Codes
  2078.         noErr                0        No error
  2079.         nsvErr                -35        No such volume
  2080.         ioErr                -36        I/O error
  2081.         bdNamErr            -37        Bad filename
  2082.         fnfErr                -43        File not found
  2083.         fLckdErr            -45        File is locked
  2084.         vLckdErr            -46        Volume is locked or read-only
  2085.         paramErr            -50        No default volume
  2086.         dirNFErr            -120    Directory not found or incomplete pathname
  2087.         afpAccessDenied        -5000    User does not have the correct access
  2088.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2089.     
  2090.     __________
  2091.     
  2092.     See also:    SetIsStationery, FSpSetIsStationery, ClearIsStationery
  2093. */
  2094.  
  2095. /*****************************************************************************/
  2096.  
  2097. pascal    OSErr    SetHasCustomIcon(short vRefNum,
  2098.                                  long dirID,
  2099.                                  ConstStr255Param name);
  2100. /*    ヲ Set the hasCustomIcon Finder Flag bit.
  2101.     The SetHasCustomIcon function sets the hasCustomIcon bit in the
  2102.     fdFlags word of the specified file or directory's finder information.
  2103.     
  2104.     vRefNum    input:    Volume specification.
  2105.     dirID    input:    Directory ID.
  2106.     name    input:    Pointer to object name, or nil when dirID specifies
  2107.                     a directory that's the object.
  2108.     
  2109.     Result Codes
  2110.         noErr                0        No error
  2111.         nsvErr                -35        No such volume
  2112.         ioErr                -36        I/O error
  2113.         bdNamErr            -37        Bad filename
  2114.         fnfErr                -43        File not found
  2115.         fLckdErr            -45        File is locked
  2116.         vLckdErr            -46        Volume is locked or read-only
  2117.         paramErr            -50        No default volume
  2118.         dirNFErr            -120    Directory not found or incomplete pathname
  2119.         afpAccessDenied        -5000    User does not have the correct access
  2120.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2121.     
  2122.     __________
  2123.     
  2124.     See also:    FSpSetHasCustomIcon, ClearHasCustomIcon, FSpClearHasCustomIcon
  2125. */
  2126.  
  2127. /*****************************************************************************/
  2128.  
  2129. pascal    OSErr    FSpSetHasCustomIcon(const FSSpec *spec);
  2130. /*    ヲ Set the hasCustomIcon Finder Flag bit.
  2131.     The FSpSetHasCustomIcon function sets the hasCustomIcon bit in the
  2132.     fdFlags word of the specified file or directory's finder information.
  2133.     
  2134.     spec    input:    An FSSpec record specifying the object.
  2135.     
  2136.     Result Codes
  2137.         noErr                0        No error
  2138.         nsvErr                -35        No such volume
  2139.         ioErr                -36        I/O error
  2140.         bdNamErr            -37        Bad filename
  2141.         fnfErr                -43        File not found
  2142.         fLckdErr            -45        File is locked
  2143.         vLckdErr            -46        Volume is locked or read-only
  2144.         paramErr            -50        No default volume
  2145.         dirNFErr            -120    Directory not found or incomplete pathname
  2146.         afpAccessDenied        -5000    User does not have the correct access
  2147.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2148.     
  2149.     __________
  2150.     
  2151.     See also:    SetHasCustomIcon, ClearHasCustomIcon, FSpClearHasCustomIcon
  2152. */
  2153.  
  2154. /*****************************************************************************/
  2155.  
  2156. pascal    OSErr    ClearHasCustomIcon(short vRefNum,
  2157.                                    long dirID,
  2158.                                    ConstStr255Param name);
  2159. /*    ヲ Clear the hasCustomIcon Finder Flag bit.
  2160.     The ClearHasCustomIcon function clears the hasCustomIcon bit in the
  2161.     fdFlags word of the specified file or directory's finder information.
  2162.     
  2163.     vRefNum    input:    Volume specification.
  2164.     dirID    input:    Directory ID.
  2165.     name    input:    Pointer to object name, or nil when dirID specifies
  2166.                     a directory that's the object.
  2167.     
  2168.     Result Codes
  2169.         noErr                0        No error
  2170.         nsvErr                -35        No such volume
  2171.         ioErr                -36        I/O error
  2172.         bdNamErr            -37        Bad filename
  2173.         fnfErr                -43        File not found
  2174.         fLckdErr            -45        File is locked
  2175.         vLckdErr            -46        Volume is locked or read-only
  2176.         paramErr            -50        No default volume
  2177.         dirNFErr            -120    Directory not found or incomplete pathname
  2178.         afpAccessDenied        -5000    User does not have the correct access
  2179.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2180.     
  2181.     __________
  2182.     
  2183.     See also:    SetHasCustomIcon, FSpSetHasCustomIcon, FSpClearHasCustomIcon
  2184. */
  2185.  
  2186. /*****************************************************************************/
  2187.  
  2188. pascal    OSErr    FSpClearHasCustomIcon(const FSSpec *spec);
  2189. /*    ヲ Clear the hasCustomIcon Finder Flag bit.
  2190.     The FSpClearHasCustomIcon function clears the hasCustomIcon bit in the
  2191.     fdFlags word of the specified file or directory's finder information.
  2192.     
  2193.     spec    input:    An FSSpec record specifying the object.
  2194.     
  2195.     Result Codes
  2196.         noErr                0        No error
  2197.         nsvErr                -35        No such volume
  2198.         ioErr                -36        I/O error
  2199.         bdNamErr            -37        Bad filename
  2200.         fnfErr                -43        File not found
  2201.         fLckdErr            -45        File is locked
  2202.         vLckdErr            -46        Volume is locked or read-only
  2203.         paramErr            -50        No default volume
  2204.         dirNFErr            -120    Directory not found or incomplete pathname
  2205.         afpAccessDenied        -5000    User does not have the correct access
  2206.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2207.     
  2208.     __________
  2209.     
  2210.     See also:    SetHasCustomIcon, FSpSetHasCustomIcon, ClearHasCustomIcon
  2211. */
  2212.  
  2213. /*****************************************************************************/
  2214.  
  2215. pascal    OSErr    ClearHasBeenInited(short vRefNum,
  2216.                                    long dirID,
  2217.                                    ConstStr255Param name);
  2218. /*    ヲ Clear the hasBeenInited Finder Flag bit.
  2219.     The ClearHasBeenInited function clears the hasBeenInited bit in the
  2220.     fdFlags word of the specified file or directory's finder information.
  2221.     
  2222.     vRefNum    input:    Volume specification.
  2223.     dirID    input:    Directory ID.
  2224.     name    input:    Pointer to object name, or nil when dirID specifies
  2225.                     a directory that's the object.
  2226.     
  2227.     Result Codes
  2228.         noErr                0        No error
  2229.         nsvErr                -35        No such volume
  2230.         ioErr                -36        I/O error
  2231.         bdNamErr            -37        Bad filename
  2232.         fnfErr                -43        File not found
  2233.         fLckdErr            -45        File is locked
  2234.         vLckdErr            -46        Volume is locked or read-only
  2235.         paramErr            -50        No default volume
  2236.         dirNFErr            -120    Directory not found or incomplete pathname
  2237.         afpAccessDenied        -5000    User does not have the correct access
  2238.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2239.     
  2240.     __________
  2241.     
  2242.     See also:    FSpClearHasBeenInited
  2243. */
  2244.  
  2245. /*****************************************************************************/
  2246.  
  2247. pascal    OSErr    FSpClearHasBeenInited(const FSSpec *spec);
  2248. /*    ヲ Clear the hasBeenInited Finder Flag bit.
  2249.     The FSpClearHasBeenInited function clears the hasBeenInited bit in the
  2250.     fdFlags word of the specified file or directory's finder information.
  2251.     
  2252.     spec    input:    An FSSpec record specifying the object.
  2253.     
  2254.     Result Codes
  2255.         noErr                0        No error
  2256.         nsvErr                -35        No such volume
  2257.         ioErr                -36        I/O error
  2258.         bdNamErr            -37        Bad filename
  2259.         fnfErr                -43        File not found
  2260.         fLckdErr            -45        File is locked
  2261.         vLckdErr            -46        Volume is locked or read-only
  2262.         paramErr            -50        No default volume
  2263.         dirNFErr            -120    Directory not found or incomplete pathname
  2264.         afpAccessDenied        -5000    User does not have the correct access
  2265.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2266.     
  2267.     __________
  2268.     
  2269.     See also:    ClearHasBeenInited
  2270. */
  2271.  
  2272. /*****************************************************************************/
  2273.  
  2274. pascal    OSErr    CopyFileMgrAttributes(short srcVRefNum,
  2275.                                       long srcDirID,
  2276.                                       ConstStr255Param srcName,
  2277.                                       short dstVRefNum,
  2278.                                       long dstDirID,
  2279.                                       ConstStr255Param dstName,
  2280.                                       Boolean copyLockBit);
  2281. /*    ヲ Copy all File Manager attributes from the source to the destination.
  2282.     The CopyFileMgrAttributes function copies all File Manager attributes
  2283.     from the source file or directory to the destination file or directory.
  2284.     If copyLockBit is true, then set the locked state of the destination
  2285.     to match the source.
  2286.  
  2287.     srcVRefNum    input:    Source volume specification.
  2288.     srcDirID    input:    Source directory ID.
  2289.     srcName        input:    Pointer to source object name, or nil when
  2290.                         srcDirID specifies a directory that's the object.
  2291.     dstVRefNum    input:    Destination volume specification.
  2292.     dstDirID    input:    Destination directory ID.
  2293.     dstName        input:    Pointer to destination object name, or nil when
  2294.                         dstDirID specifies a directory that's the object.
  2295.     copyLockBit    input:    If true, set the locked state of the destination
  2296.                         to match the source.
  2297.     
  2298.     Result Codes
  2299.         noErr                0        No error
  2300.         nsvErr                -35        No such volume
  2301.         ioErr                -36        I/O error
  2302.         bdNamErr            -37        Bad filename
  2303.         fnfErr                -43        File not found
  2304.         fLckdErr            -45        File is locked
  2305.         vLckdErr            -46        Volume is locked or read-only
  2306.         paramErr            -50        No default volume
  2307.         dirNFErr            -120    Directory not found or incomplete pathname
  2308.         afpAccessDenied        -5000    User does not have the correct access
  2309.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2310.     
  2311.     __________
  2312.     
  2313.     See also:    FSpCopyFileMgrAttributes
  2314. */
  2315.  
  2316. /*****************************************************************************/
  2317.  
  2318. pascal    OSErr    FSpCopyFileMgrAttributes(const FSSpec *srcSpec,
  2319.                                          const FSSpec *dstSpec,
  2320.                                          Boolean copyLockBit);
  2321. /*    ヲ Copy all File Manager attributes from the source to the destination.
  2322.     The FSpCopyFileMgrAttributes function copies all File Manager attributes
  2323.     from the source file or directory to the destination file or directory.
  2324.     If copyLockBit is true, then set the locked state of the destination
  2325.     to match the source.
  2326.  
  2327.     srcSpec        input:    An FSSpec record specifying the source object.
  2328.     dstSpec        input:    An FSSpec record specifying the destination object.
  2329.     copyLockBit    input:    If true, set the locked state of the destination
  2330.                         to match the source.
  2331.     
  2332.     Result Codes
  2333.         noErr                0        No error
  2334.         nsvErr                -35        No such volume
  2335.         ioErr                -36        I/O error
  2336.         bdNamErr            -37        Bad filename
  2337.         fnfErr                -43        File not found
  2338.         fLckdErr            -45        File is locked
  2339.         vLckdErr            -46        Volume is locked or read-only
  2340.         paramErr            -50        No default volume
  2341.         dirNFErr            -120    Directory not found or incomplete pathname
  2342.         afpAccessDenied        -5000    User does not have the correct access
  2343.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2344.     
  2345.     __________
  2346.     
  2347.     See also:    CopyFileMgrAttributes
  2348. */
  2349.  
  2350. /*****************************************************************************/
  2351.  
  2352. pascal    OSErr    HOpenAware(short vRefNum,
  2353.                            long dirID,
  2354.                            ConstStr255Param fileName,
  2355.                            short denyModes,
  2356.                            short *refNum);
  2357. /*    ヲ Open the data fork of a file using deny mode permissions.
  2358.     The HOpenAware function opens the data fork of a file using deny mode
  2359.     permissions instead the normal File Manager permissions.  If OpenDeny
  2360.     is not available, then HOpenAware translates the deny modes to the
  2361.     closest File Manager permissions and tries to open the file with
  2362.     OpenDF first, and then Open if OpenDF isn't available. By using
  2363.     HOpenAware with deny mode permissions, a program can be "AppleShare
  2364.     aware" and fall back on the standard File Manager open calls
  2365.     automatically.
  2366.  
  2367.     vRefNum        input:    Volume specification.
  2368.     dirID        input:    Directory ID.
  2369.     fileName    input:    The name of the file.
  2370.     denyModes    input:    The deny modes access under which to open the file.
  2371.     refNum        output:    The file reference number of the opened file.
  2372.     
  2373.     Result Codes
  2374.         noErr                0        No error
  2375.         nsvErr                -35        No such volume
  2376.         tmfoErr                -42        Too many files open
  2377.         fnfErr                -43        File not found
  2378.         wPrErr                -44        Volume locked by hardware
  2379.         fLckdErr            -45        File is locked
  2380.         vLckdErr            -46        Volume is locked or read-only
  2381.         opWrErr                -49        File already open for writing
  2382.         paramErr            -50        No default volume
  2383.         permErr                 -54        File is already open and cannot be opened using specified deny modes
  2384.         afpAccessDenied        -5000    User does not have the correct access to the file
  2385.         afpDenyConflict        -5006    Requested access permission not possible
  2386.     
  2387.     __________
  2388.     
  2389.     See also:    FSpOpenAware, HOpenRFAware, FSpOpenRFAware
  2390. */
  2391.  
  2392. /*****************************************************************************/
  2393.  
  2394. pascal    OSErr    FSpOpenAware(const FSSpec *spec,
  2395.                              short denyModes,
  2396.                              short *refNum);
  2397. /*    ヲ Open the data fork of a file using deny mode permissions.
  2398.     The FSpOpenAware function opens the data fork of a file using deny mode
  2399.     permissions instead the normal File Manager permissions.  If OpenDeny
  2400.     is not available, then FSpOpenAware translates the deny modes to the
  2401.     closest File Manager permissions and tries to open the file with
  2402.     OpenDF first, and then Open if OpenDF isn't available. By using
  2403.     FSpOpenAware with deny mode permissions, a program can be "AppleShare
  2404.     aware" and fall back on the standard File Manager open calls
  2405.     automatically.
  2406.  
  2407.     spec        input:    An FSSpec record specifying the file.
  2408.     denyModes    input:    The deny modes access under which to open the file.
  2409.     refNum        output:    The file reference number of the opened file.
  2410.     
  2411.     Result Codes
  2412.         noErr                0        No error
  2413.         nsvErr                -35        No such volume
  2414.         tmfoErr                -42        Too many files open
  2415.         fnfErr                -43        File not found
  2416.         wPrErr                -44        Volume locked by hardware
  2417.         fLckdErr            -45        File is locked
  2418.         vLckdErr            -46        Volume is locked or read-only
  2419.         opWrErr                -49        File already open for writing
  2420.         paramErr            -50        No default volume
  2421.         permErr                 -54        File is already open and cannot be opened using specified deny modes
  2422.         afpAccessDenied        -5000    User does not have the correct access to the file
  2423.         afpDenyConflict        -5006    Requested access permission not possible
  2424.     
  2425.     __________
  2426.     
  2427.     See also:    HOpenAware, HOpenRFAware, FSpOpenRFAware
  2428. */
  2429.  
  2430. /*****************************************************************************/
  2431.  
  2432. pascal    OSErr    HOpenRFAware(short vRefNum,
  2433.                              long dirID,
  2434.                              ConstStr255Param fileName,
  2435.                              short denyModes,
  2436.                              short *refNum);
  2437. /*    ヲ Open the resource fork of a file using deny mode permissions.
  2438.     The HOpenRFAware function opens the resource fork of a file using deny
  2439.     mode permissions instead the normal File Manager permissions.  If
  2440.     OpenRFDeny is not available, then HOpenRFAware translates the deny
  2441.     modes to the closest File Manager permissions and tries to open the
  2442.     file with OpenRF. By using HOpenRFAware with deny mode permissions,
  2443.     a program can be "AppleShare aware" and fall back on the standard
  2444.     File Manager open calls automatically.
  2445.  
  2446.     vRefNum        input:    Volume specification.
  2447.     dirID        input:    Directory ID.
  2448.     fileName    input:    The name of the file.
  2449.     denyModes    input:    The deny modes access under which to open the file.
  2450.     refNum        output:    The file reference number of the opened file.
  2451.     
  2452.     Result Codes
  2453.         noErr                0        No error
  2454.         nsvErr                -35        No such volume
  2455.         tmfoErr                -42        Too many files open
  2456.         fnfErr                -43        File not found
  2457.         wPrErr                -44        Volume locked by hardware
  2458.         fLckdErr            -45        File is locked
  2459.         vLckdErr            -46        Volume is locked or read-only
  2460.         opWrErr                -49        File already open for writing
  2461.         paramErr            -50        No default volume
  2462.         permErr                 -54        File is already open and cannot be opened using specified deny modes
  2463.         afpAccessDenied        -5000    User does not have the correct access to the file
  2464.         afpDenyConflict        -5006    Requested access permission not possible
  2465.     
  2466.     __________
  2467.     
  2468.     See also:    HOpenAware, FSpOpenAware, FSpOpenRFAware
  2469. */
  2470.  
  2471. /*****************************************************************************/
  2472.  
  2473. pascal    OSErr    FSpOpenRFAware(const FSSpec *spec,
  2474.                                short denyModes,
  2475.                                short *refNum);
  2476. /*    ヲ Open the resource fork of a file using deny mode permissions.
  2477.     The FSpOpenRFAware function opens the resource fork of a file using deny
  2478.     mode permissions instead the normal File Manager permissions.  If
  2479.     OpenRFDeny is not available, then FSpOpenRFAware translates the deny
  2480.     modes to the closest File Manager permissions and tries to open the
  2481.     file with OpenRF. By using FSpOpenRFAware with deny mode permissions,
  2482.     a program can be "AppleShare aware" and fall back on the standard
  2483.     File Manager open calls automatically.
  2484.  
  2485.     spec        input:    An FSSpec record specifying the file.
  2486.     denyModes    input:    The deny modes access under which to open the file.
  2487.     refNum        output:    The file reference number of the opened file.
  2488.     
  2489.     Result Codes
  2490.         noErr                0        No error
  2491.         nsvErr                -35        No such volume
  2492.         tmfoErr                -42        Too many files open
  2493.         fnfErr                -43        File not found
  2494.         wPrErr                -44        Volume locked by hardware
  2495.         fLckdErr            -45        File is locked
  2496.         vLckdErr            -46        Volume is locked or read-only
  2497.         opWrErr                -49        File already open for writing
  2498.         paramErr            -50        No default volume
  2499.         permErr                 -54        File is already open and cannot be opened using specified deny modes
  2500.         afpAccessDenied        -5000    User does not have the correct access to the file
  2501.         afpDenyConflict        -5006    Requested access permission not possible
  2502.     
  2503.     __________
  2504.     
  2505.     See also:    HOpenAware, FSpOpenAware, HOpenRFAware
  2506. */
  2507.  
  2508. /*****************************************************************************/
  2509.  
  2510. pascal    OSErr    FSReadNoCache(short refNum,
  2511.                               long *count,
  2512.                               void *buffPtr);
  2513. /*    ヲ Read any number of bytes from an open file requesting no caching.
  2514.     The FSReadNoCache function reads any number of bytes from an open file
  2515.     while asking the file system to bypass its cache mechanism.
  2516.     
  2517.     refNum    input:    The file reference number of an open file.
  2518.     count    input:    The number of bytes to read.
  2519.             output:    The number of bytes actually read.
  2520.     buffPtr    input:    A pointer to the data buffer into which the bytes are
  2521.                     to be read.
  2522.     
  2523.     Result Codes
  2524.         noErr                0        No error
  2525.         readErr                ミ19        Driver does not respond to read requests
  2526.         badUnitErr            ミ21        Driver reference number does not
  2527.                                     match unit table
  2528.         unitEmptyErr        ミ22        Driver reference number specifies a
  2529.                                     nil handle in unit table
  2530.         abortErr            ミ27        Request aborted by KillIO
  2531.         notOpenErr            ミ28        Driver not open
  2532.         ioErr                ミ36        Data does not match in read-verify mode
  2533.         fnOpnErr            -38        File not open
  2534.         rfNumErr            -51        Bad reference number
  2535.         afpAccessDenied        -5000    User does not have the correct access to
  2536.                                     the file
  2537.  
  2538.     __________
  2539.     
  2540.     See also:    FSWriteNoCache
  2541. */
  2542.  
  2543. /*****************************************************************************/
  2544.  
  2545. pascal    OSErr    FSWriteNoCache(short refNum,
  2546.                                long *count,
  2547.                                const void *buffPtr);
  2548. /*    ヲ Write any number of bytes to an open file requesting no caching.
  2549.     The FSReadNoCache function writes any number of bytes to an open file
  2550.     while asking the file system to bypass its cache mechanism.
  2551.     
  2552.     refNum    input:    The file reference number of an open file.
  2553.     count    input:    The number of bytes to write to the file.
  2554.             output:    The number of bytes actually written.
  2555.     buffPtr    input:    A pointer to the data buffer from which the bytes are
  2556.                     to be written.
  2557.     
  2558.     Result Codes
  2559.         noErr                0        No error
  2560.         writErr                ミ20        Driver does not respond to write requests
  2561.         badUnitErr            ミ21        Driver reference number does not
  2562.                                     match unit table
  2563.         unitEmptyErr        ミ22        Driver reference number specifies a
  2564.                                     nil handle in unit table
  2565.         abortErr            ミ27        Request aborted by KillIO
  2566.         notOpenErr            ミ28        Driver not open
  2567.         dskFulErr            -34        Disk full    
  2568.         ioErr                ミ36        Data does not match in read-verify mode
  2569.         fnOpnErr            -38        File not open
  2570.         wPrErr                -44        Hardware volume lock    
  2571.         fLckdErr            -45        File is locked    
  2572.         vLckdErr            -46        Software volume lock    
  2573.         rfNumErr            -51        Bad reference number
  2574.         wrPermErr            -61        Read/write permission doesnユt
  2575.                                     allow writing    
  2576.         afpAccessDenied        -5000    User does not have the correct access to
  2577.                                     the file
  2578.  
  2579.     __________
  2580.     
  2581.     See also:    FSReadNoCache
  2582. */
  2583.  
  2584. /*****************************************************************************/
  2585.  
  2586. pascal    OSErr    FSWriteVerify(short refNum,
  2587.                               long *count,
  2588.                               const void *buffPtr);
  2589. /*    ヲ Write any number of bytes to an open file and then verify the data was written.
  2590.     The FSWriteVerify function writes any number of bytes to an open file
  2591.     and then verifies that the data was actually written to the device.
  2592.     
  2593.     refNum    input:    The file reference number of an open file.
  2594.     count    input:    The number of bytes to write to the file.
  2595.             output:    The number of bytes actually written and verified.
  2596.     buffPtr    input:    A pointer to the data buffer from which the bytes are
  2597.                     to be written.
  2598.     
  2599.     Result Codes
  2600.         noErr                0        No error
  2601.         readErr                ミ19        Driver does not respond to read requests
  2602.         writErr                ミ20        Driver does not respond to write requests
  2603.         badUnitErr            ミ21        Driver reference number does not
  2604.                                     match unit table
  2605.         unitEmptyErr        ミ22        Driver reference number specifies a
  2606.                                     nil handle in unit table
  2607.         abortErr            ミ27        Request aborted by KillIO
  2608.         notOpenErr            ミ28        Driver not open
  2609.         dskFulErr            -34        Disk full    
  2610.         ioErr                ミ36        Data does not match in read-verify mode
  2611.         fnOpnErr            -38        File not open
  2612.         eofErr                -39        Logical end-of-file reached
  2613.         posErr                -40        Attempt to position mark before start
  2614.                                     of file
  2615.         wPrErr                -44        Hardware volume lock    
  2616.         fLckdErr            -45        File is locked    
  2617.         vLckdErr            -46        Software volume lock    
  2618.         rfNumErr            -51        Bad reference number
  2619.         gfpErr                -52        Error during GetFPos
  2620.         wrPermErr            -61        Read/write permission doesnユt
  2621.                                     allow writing    
  2622.         memFullErr            -108    Not enough room in heap zone to allocate
  2623.                                     verify buffer
  2624.         afpAccessDenied        -5000    User does not have the correct access to
  2625.                                     the file
  2626. */
  2627.  
  2628. /*****************************************************************************/
  2629.  
  2630. pascal    OSErr    CopyFork(short srcRefNum,
  2631.                          short dstRefNum,
  2632.                          void *copyBufferPtr,
  2633.                          long copyBufferSize);
  2634. /*    ヲ Copy all data from the source fork to the destination fork of open file forks.
  2635.     The CopyFork function copies all data from the source fork to the
  2636.     destination fork of open file forks and makes sure the destination EOF
  2637.     is equal to the source EOF.
  2638.     
  2639.     srcRefNum        input:    The source file reference number.
  2640.     dstRefNum        input:    The destination file reference number.
  2641.     copyBufferPtr    input:    Pointer to buffer to use during copy. The
  2642.                             buffer should be at least 512-bytes minimum.
  2643.                             The larger the buffer, the faster the copy.
  2644.     copyBufferSize    input:    The size of the copy buffer.
  2645.     
  2646.     Result Codes
  2647.         noErr                0        No error
  2648.         readErr                ミ19        Driver does not respond to read requests
  2649.         writErr                ミ20        Driver does not respond to write requests
  2650.         badUnitErr            ミ21        Driver reference number does not
  2651.                                     match unit table
  2652.         unitEmptyErr        ミ22        Driver reference number specifies a
  2653.                                     nil handle in unit table
  2654.         abortErr            ミ27        Request aborted by KillIO
  2655.         notOpenErr            ミ28        Driver not open
  2656.         dskFulErr            -34        Disk full    
  2657.         ioErr                ミ36        Data does not match in read-verify mode
  2658.         fnOpnErr            -38        File not open
  2659.         wPrErr                -44        Hardware volume lock    
  2660.         fLckdErr            -45        File is locked    
  2661.         vLckdErr            -46        Software volume lock    
  2662.         rfNumErr            -51        Bad reference number
  2663.         wrPermErr            -61        Read/write permission doesnユt
  2664.                                     allow writing    
  2665.         afpAccessDenied        -5000    User does not have the correct access to
  2666.                                     the file
  2667. */
  2668.  
  2669. /*****************************************************************************/
  2670.  
  2671. pascal    OSErr    GetFileLocation(short refNum,
  2672.                                 short *vRefNum,
  2673.                                 long *dirID,
  2674.                                 StringPtr fileName);
  2675. /*    ヲ Get the location of an open file.
  2676.     The GetFileLocation function gets the location (volume reference number,
  2677.     directory ID, and fileName) of an open file.
  2678.  
  2679.     refNum        input:    The file reference number of an open file.
  2680.     vRefNum        output:    The volume reference number.
  2681.     dirID        output:    The parent directory ID.
  2682.     fileName    input:    Points to a buffer (minimum Str63) where the
  2683.                         filename is to be returned or must be nil.
  2684.                 output:    The filename.
  2685.     
  2686.     Result Codes
  2687.         noErr                0        No error
  2688.         nsvErr                -35        Specified volume doesnユt exist
  2689.         fnOpnErr            -38        File not open
  2690.         rfNumErr            -51        Reference number specifies nonexistent
  2691.                                     access path
  2692.     
  2693.     __________
  2694.     
  2695.     See also:    FSpGetFileLocation
  2696. */
  2697.  
  2698. /*****************************************************************************/
  2699.  
  2700. pascal    OSErr    FSpGetFileLocation(short refNum,
  2701.                                    FSSpec *spec);
  2702. /*    ヲ Get the location of an open file in an FSSpec record.
  2703.     The FSpGetFileLocation function gets the location of an open file in
  2704.     an FSSpec record.
  2705.  
  2706.     refNum        input:    The file reference number of an open file.
  2707.     spec        output:    FSSpec record containing the file name and location.
  2708.     
  2709.     Result Codes
  2710.         noErr                0        No error
  2711.         nsvErr                -35        Specified volume doesnユt exist
  2712.         fnOpnErr            -38        File not open
  2713.         rfNumErr            -51        Reference number specifies nonexistent
  2714.                                     access path
  2715.     
  2716.     __________
  2717.     
  2718.     See also:    GetFileLocation
  2719. */
  2720.  
  2721. /*****************************************************************************/
  2722.  
  2723. pascal    OSErr    CopyDirectoryAccess(short srcVRefNum,
  2724.                                     long srcDirID,
  2725.                                     ConstStr255Param srcName,
  2726.                                     short dstVRefNum,
  2727.                                     long dstDirID,
  2728.                                     ConstStr255Param dstName);
  2729. /*    ヲ Copy the AFP directory access privileges.
  2730.     The CopyDirectoryAccess function copies the AFP directory access
  2731.     privileges from one directory to another. Both directories must be on
  2732.     the same file server, but not necessarily on the same server volume.
  2733.     
  2734.     srcVRefNum    input:    Source volume specification.
  2735.     srcDirID    input:    Source directory ID.
  2736.     srcName        input:    Pointer to source directory name, or nil when
  2737.                         srcDirID specifies the directory.
  2738.     dstVRefNum    input:    Destination volume specification.
  2739.     dstDirID    input:    Destination directory ID.
  2740.     dstName        input:    Pointer to destination directory name, or nil when
  2741.                         dstDirID specifies the directory.
  2742.     
  2743.     Result Codes
  2744.         noErr                0        No error
  2745.         nsvErr                -35        Volume not found
  2746.         fnfErr                -43        Directory not found
  2747.         vLckdErr            -46        Volume is locked or read-only
  2748.         paramErr            -50        Volume doesn't support this function
  2749.         afpAccessDenied        -5000    User does not have the correct access
  2750.                                     to the directory
  2751.         afpObjectTypeErr    -5025    Object is a file, not a directory
  2752.     
  2753.     __________
  2754.     
  2755.     See also:    FSpCopyDirectoryAccess
  2756. */
  2757.  
  2758. /*****************************************************************************/
  2759.  
  2760. pascal    OSErr    FSpCopyDirectoryAccess(const FSSpec *srcSpec,
  2761.                                        const FSSpec *dstSpec);
  2762. /*    ヲ Copy the AFP directory access privileges.
  2763.     The FSpCopyDirectoryAccess function copies the AFP directory access
  2764.     privileges from one directory to another. Both directories must be on
  2765.     the same file server, but not necessarily on the same server volume.
  2766.  
  2767.     srcSpec        input:    An FSSpec record specifying the source directory.
  2768.     dstSpec        input:    An FSSpec record specifying the destination directory.
  2769.     
  2770.     Result Codes
  2771.         noErr                0        No error
  2772.         nsvErr                -35        Volume not found
  2773.         fnfErr                -43        Directory not found
  2774.         vLckdErr            -46        Volume is locked or read-only
  2775.         paramErr            -50        Volume doesn't support this function
  2776.         afpAccessDenied        -5000    User does not have the correct access
  2777.                                     to the directory
  2778.         afpObjectTypeErr    -5025    Object is a file, not a directory
  2779.     
  2780.     __________
  2781.     
  2782.     See also:    CopyDirectoryAccess
  2783. */
  2784.  
  2785. /*****************************************************************************/
  2786.  
  2787. pascal    OSErr    HMoveRenameCompat(short vRefNum,
  2788.                                   long srcDirID,
  2789.                                   ConstStr255Param srcName,
  2790.                                   long dstDirID,
  2791.                                   ConstStr255Param dstpathName,
  2792.                                   ConstStr255Param copyName);
  2793. /*    ヲ Move a file or directory and optionally rename it.
  2794.     The HMoveRenameCompat function moves a file or directory and optionally
  2795.     renames it.  The source and destination locations must be on the same
  2796.     volume. This routine works even if the volume doesn't support MoveRename.
  2797.     
  2798.     vRefNum        input:    Volume specification.
  2799.     srcDirID    input:    Source directory ID.
  2800.     srcName        input:    The source object name.
  2801.     dstDirID    input:    Destination directory ID.
  2802.     dstName        input:    Pointer to destination directory name, or
  2803.                         nil when dstDirID specifies a directory.
  2804.     copyName    input:    Points to the new name if the object is to be
  2805.                         renamed or nil if the object isn't to be renamed.
  2806.     
  2807.     Result Codes
  2808.         noErr                0        No error
  2809.         dirFulErr            -33        File directory full
  2810.         dskFulErr            -34        Disk is full
  2811.         nsvErr                -35        Volume not found
  2812.         ioErr                -36        I/O error
  2813.         bdNamErr            -37        Bad filename or attempt to move into
  2814.                                     a file
  2815.         fnfErr                -43        Source file or directory not found
  2816.         wPrErr                -44        Hardware volume lock
  2817.         fLckdErr            -45        File is locked
  2818.         vLckdErr            -46        Destination volume is read-only
  2819.         fBsyErr                -47        File busy, directory not empty, or
  2820.                                     working directory control block open
  2821.         dupFNErr            -48        Destination already exists
  2822.         paramErr            -50        Volume doesn't support this function,
  2823.                                     no default volume, or source and
  2824.         volOfflinErr        -53        Volume is offline
  2825.         fsRnErr                -59        Problem during rename
  2826.         dirNFErr            -120    Directory not found or incomplete pathname
  2827.         badMovErr            -122    Attempted to move directory into
  2828.                                     offspring
  2829.         wrgVolTypErr        -123    Not an HFS volume (it's a MFS volume)
  2830.         notAFileErr            -1302    The pathname is nil, the pathname
  2831.                                     is empty, or the pathname cannot refer
  2832.                                     to a filename
  2833.         diffVolErr            -1303    Files on different volumes
  2834.         afpAccessDenied        -5000    The user does not have the right to
  2835.                                     move the file  or directory
  2836.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2837.         afpSameObjectErr    -5038    Source and destination files are the same
  2838.     
  2839.     __________
  2840.     
  2841.     See also:    FSpMoveRenameCompat
  2842. */
  2843.  
  2844. /*****************************************************************************/
  2845.  
  2846. pascal    OSErr    FSpMoveRenameCompat(const FSSpec *srcSpec,
  2847.                                     const FSSpec *dstSpec,
  2848.                                     ConstStr255Param copyName);
  2849. /*    ヲ Move a file or directory and optionally rename it.
  2850.     The FSpMoveRenameCompat function moves a file or directory and optionally
  2851.     renames it.  The source and destination locations must be on the same
  2852.     volume. This routine works even if the volume doesn't support MoveRename.
  2853.     
  2854.     srcSpec        input:    An FSSpec record specifying the source object.
  2855.     dstSpec        input:    An FSSpec record specifying the destination
  2856.                         directory.
  2857.     copyName    input:    Points to the new name if the object is to be
  2858.                         renamed or nil if the object isn't to be renamed.
  2859.     
  2860.     Result Codes
  2861.         noErr                0        No error
  2862.         dirFulErr            -33        File directory full
  2863.         dskFulErr            -34        Disk is full
  2864.         nsvErr                -35        Volume not found
  2865.         ioErr                -36        I/O error
  2866.         bdNamErr            -37        Bad filename or attempt to move into
  2867.                                     a file
  2868.         fnfErr                -43        Source file or directory not found
  2869.         wPrErr                -44        Hardware volume lock
  2870.         fLckdErr            -45        File is locked
  2871.         vLckdErr            -46        Destination volume is read-only
  2872.         fBsyErr                -47        File busy, directory not empty, or
  2873.                                     working directory control block open
  2874.         dupFNErr            -48        Destination already exists
  2875.         paramErr            -50        Volume doesn't support this function,
  2876.                                     no default volume, or source and
  2877.         volOfflinErr        -53        Volume is offline
  2878.         fsRnErr                -59        Problem during rename
  2879.         dirNFErr            -120    Directory not found or incomplete pathname
  2880.         badMovErr            -122    Attempted to move directory into
  2881.                                     offspring
  2882.         wrgVolTypErr        -123    Not an HFS volume (it's a MFS volume)
  2883.         notAFileErr            -1302    The pathname is nil, the pathname
  2884.                                     is empty, or the pathname cannot refer
  2885.                                     to a filename
  2886.         diffVolErr            -1303    Files on different volumes
  2887.         afpAccessDenied        -5000    The user does not have the right to
  2888.                                     move the file  or directory
  2889.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2890.         afpSameObjectErr    -5038    Source and destination files are the same
  2891.     
  2892.     __________
  2893.     
  2894.     See also:    HMoveRenameCompat
  2895. */
  2896.  
  2897. /*****************************************************************************/
  2898.  
  2899. pascal    OSErr    BuildAFPVolMountInfo(short flags,
  2900.                                      char nbpInterval,
  2901.                                      char nbpCount,
  2902.                                      short uamType,
  2903.                                      Str32 zoneName,
  2904.                                      Str31 serverName,
  2905.                                      Str27 volName,
  2906.                                      Str31 userName,
  2907.                                      Str8 userPassword,
  2908.                                      Str8 volPassword,
  2909.                                      AFPVolMountInfoPtr *afpInfoPtr);
  2910. /*    ヲ Allocate and initializes the fields of an AFPVolMountInfo record.
  2911.     The BuildAFPVolMountInfo function allocates and initializes the fields
  2912.     of an AFPVolMountInfo record before using that record to call
  2913.     the VolumeMount function.
  2914.     
  2915.     flags            input:    The AFP mounting flags. 0 = normal mount;
  2916.                             set bit 0 to inhibit greeting messages.
  2917.     nbpInterval        input:    The interval used for VolumeMount's
  2918.                             NBP Lookup call. 7 is a good choice.
  2919.     nbpCount        input:    The retry count used for VolumeMount's
  2920.                             NBP Lookup call. 5 is a good choice.
  2921.     uamType            input:    The user authentication method to use.
  2922.     zoneName        input:    The AppleTalk zone name of the server.
  2923.     serverName        input:    The AFP server name.
  2924.     volName            input:    The AFP volume name.
  2925.     userName        input:    The user name (zero length Pascal string for
  2926.                             guest).
  2927.     userPassWord    input:    The user password (zero length Pascal string
  2928.                             if no user password)
  2929.     volPassWord        input:    The volume password (zero length Pascal string
  2930.                             if no volume password)
  2931.     afpInfoPtr        output:    A pointer to the newly created and initialized
  2932.                             AFPVolMountInfo record. If the function fails to
  2933.                             create an AFPVolMountInfo record, it sets
  2934.                             afpInfoPtr to NULL and the function result is
  2935.                             memFullErr. Your program is responsible
  2936.                             for disposing of this pointer when it is finished
  2937.                             with it.
  2938.     
  2939.     Result Codes
  2940.         noErr                0        No error
  2941.         memFullErr            -108    memory full error
  2942.     
  2943.     __________
  2944.     
  2945.     Also see:    GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
  2946.                 RetrieveAFPVolMountInfo, BuildAFPXVolMountInfo,
  2947.                 RetrieveAFPXVolMountInfo
  2948. */
  2949.  
  2950. /*****************************************************************************/
  2951.  
  2952. pascal    OSErr    RetrieveAFPVolMountInfo(AFPVolMountInfoPtr afpInfoPtr,
  2953.                                         short *flags,
  2954.                                         short *uamType,
  2955.                                         StringPtr zoneName,
  2956.                                         StringPtr serverName,
  2957.                                         StringPtr volName,
  2958.                                         StringPtr userName);
  2959. /*    ヲ Retrieve the AFP mounting information from an AFPVolMountInfo record.
  2960.     The RetrieveAFPVolMountInfo function retrieves the AFP mounting
  2961.     information returned in an AFPVolMountInfo record by the
  2962.     GetVolMountInfo function.
  2963.     
  2964.     afpInfoPtr        input:    Pointer to AFPVolMountInfo record that contains
  2965.                             the AFP mounting information.
  2966.     flags            output:    The AFP mounting flags.
  2967.     uamType            output:    The user authentication method used.
  2968.     zoneName        output:    The AppleTalk zone name of the server.
  2969.     serverName        output:    The AFP server name.
  2970.     volName            output:    The AFP volume name.
  2971.     userName        output:    The user name (zero length Pascal string for
  2972.                             guest).
  2973.     
  2974.     Result Codes
  2975.         noErr                0        No error
  2976.         paramErr            -50        media field in AFP mounting information
  2977.                                     was not AppleShareMediaType
  2978.     
  2979.     __________
  2980.     
  2981.     Also see:    GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
  2982.                 BuildAFPVolMountInfo, BuildAFPXVolMountInfo,
  2983.                 RetrieveAFPXVolMountInfo
  2984. */
  2985.  
  2986. /*****************************************************************************/
  2987.  
  2988. pascal    OSErr    BuildAFPXVolMountInfo(short flags,
  2989.                                       char nbpInterval,
  2990.                                       char nbpCount,
  2991.                                       short uamType,
  2992.                                       Str32 zoneName,
  2993.                                       Str31 serverName,
  2994.                                       Str27 volName,
  2995.                                       Str31 userName,
  2996.                                       Str8 userPassword,
  2997.                                       Str8 volPassword,
  2998.                                       Str32 uamName,
  2999.                                       unsigned long alternateAddressLength,
  3000.                                       void *alternateAddress,
  3001.                                       AFPXVolMountInfoPtr *afpXInfoPtr);
  3002. /*    ヲ Allocate and initializes the fields of an AFPXVolMountInfo record.
  3003.     The BuildAFPXVolMountInfo function allocates and initializes the fields
  3004.     of an AFPXVolMountInfo record before using that record to call
  3005.     the VolumeMount function.
  3006.     
  3007.     flags                    input:    The AFP mounting flags.
  3008.     nbpInterval                input:    The interval used for VolumeMount's
  3009.                                     NBP Lookup call. 7 is a good choice.
  3010.     nbpCount                input:    The retry count used for VolumeMount's
  3011.                                     NBP Lookup call. 5 is a good choice.
  3012.     uamType                    input:    The user authentication method to use.
  3013.     zoneName                input:    The AppleTalk zone name of the server.
  3014.     serverName                input:    The AFP server name.
  3015.     volName                    input:    The AFP volume name.
  3016.     userName                input:    The user name (zero length Pascal string
  3017.                                     for guest).
  3018.     userPassWord            input:    The user password (zero length Pascal
  3019.                                     string if no user password)
  3020.     volPassWord                input:    The volume password (zero length Pascal
  3021.                                     string if no volume password)
  3022.     uamName                    input:    The User Authentication Method name.
  3023.     alternateAddressLength    input:    Length of alternateAddress data.
  3024.     alternateAddress        input    The AFPAlternateAddress (variable length)
  3025.     afpXInfoPtr                output:    A pointer to the newly created and
  3026.                                     initialized AFPVolMountInfo record.
  3027.                                     If the function fails to create an
  3028.                                     AFPVolMountInfo record, it sets
  3029.                                     afpInfoPtr to NULL and the function
  3030.                                     result is memFullErr. Your program is
  3031.                                     responsible for disposing of this pointer
  3032.                                     when it is finished with it.
  3033.     
  3034.     Result Codes
  3035.         noErr                0        No error
  3036.         memFullErr            -108    memory full error
  3037.     
  3038.     __________
  3039.     
  3040.     Also see:    GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
  3041.                 BuildAFPVolMountInfo, RetrieveAFPVolMountInfo,
  3042.                 RetrieveAFPXVolMountInfo
  3043. */
  3044.  
  3045. /*****************************************************************************/
  3046.  
  3047. pascal    OSErr    RetrieveAFPXVolMountInfo(AFPXVolMountInfoPtr afpXInfoPtr,
  3048.                                          short *flags,
  3049.                                          short *uamType,
  3050.                                          StringPtr zoneName,
  3051.                                          StringPtr serverName,
  3052.                                          StringPtr volName,
  3053.                                          StringPtr userName,
  3054.                                          StringPtr uamName,
  3055.                                          unsigned long *alternateAddressLength,
  3056.                                          AFPAlternateAddress **alternateAddress);
  3057. /*    ヲ Retrieve the AFP mounting information from an AFPXVolMountInfo record.
  3058.     The RetrieveAFPXVolMountInfo function retrieves the AFP mounting
  3059.     information returned in an AFPXVolMountInfo record by the
  3060.     GetVolMountInfo function.
  3061.     
  3062.     afpXInfoPtr                input:    Pointer to AFPXVolMountInfo record that
  3063.                                     contains the AFP mounting information.
  3064.     flags                    output:    The AFP mounting flags.
  3065.     uamType                    output:    The user authentication method used.
  3066.     zoneName                output:    The AppleTalk zone name of the server.
  3067.     serverName                output:    The AFP server name.
  3068.     volName                    output:    The AFP volume name.
  3069.     userName                output:    The user name (zero length Pascal
  3070.                                     string for guest).
  3071.     uamName                    output:    The User Authentication Method name.
  3072.     alternateAddressLength    output:    Length of alternateAddress data returned.
  3073.     alternateAddress:        output:    A pointer to the newly created and
  3074.                                     AFPAlternateAddress record (a variable
  3075.                                     length record). If the function fails to
  3076.                                     create an AFPAlternateAddress record,
  3077.                                     it sets alternateAddress to NULL and the
  3078.                                     function result is memFullErr. Your
  3079.                                     program is responsible for disposing of
  3080.                                     this pointer when it is finished with it.
  3081.     
  3082.     Result Codes
  3083.         noErr                0        No error
  3084.         paramErr            -50        media field in AFP mounting information
  3085.                                     was not AppleShareMediaType
  3086.         memFullErr            -108    memory full error
  3087.     
  3088.     __________
  3089.     
  3090.     Also see:    GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
  3091.                 BuildAFPVolMountInfo, RetrieveAFXVolMountInfo,
  3092.                 BuildAFPXVolMountInfo
  3093. */
  3094.  
  3095. /*****************************************************************************/
  3096.  
  3097. pascal    OSErr    GetUGEntries(short objType,
  3098.                              UGEntryPtr entries,
  3099.                              long reqEntryCount,
  3100.                              long *actEntryCount,
  3101.                              long *objID);
  3102. /*    ヲ Retrieve a list of user or group entries from the local file server.
  3103.     The GetUGEntries functions retrieves a list of user or group entries
  3104.     from the local file server.
  3105.  
  3106.     objType            input:    The object type: -1 = group; 0 = user
  3107.     UGEntries        input:    Pointer to array of UGEntry records where the list
  3108.                             is returned.
  3109.     reqEntryCount    input:    The number of elements in the UGEntries array.
  3110.     actEntryCount    output:    The number of entries returned.
  3111.     objID            input:    The current index position. Set to 0 to start with
  3112.                             the first entry.
  3113.                     output:    The index position to get the next entry. Pass this
  3114.                             value the next time you call GetUGEntries to start
  3115.                             where you left off.
  3116.     
  3117.     Result Codes
  3118.         noErr                0        No error    
  3119.         fnfErr                -43        No more users or groups    
  3120.         paramErr            -50        Function not supported; or, ioObjID is
  3121.                                     negative    
  3122.  
  3123.     __________
  3124.     
  3125.     Also see:    GetUGEntry
  3126. */
  3127.  
  3128. /*****************************************************************************/
  3129.  
  3130. #ifdef __cplusplus
  3131. }
  3132. #endif
  3133.  
  3134. #include "OptimizationEnd.h"
  3135.  
  3136. #endif    /* __MOREFILESEXTRAS__ */
  3137.